1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include
"nsIInputStream.idl"
7 [scriptable
, builtinclass
, uuid(8149be1f
-44d3
-4f14
-8b65
-a57a5fbbeb97
)]
8 interface nsICloneableInputStream
: nsISupports
10 // Allow streams that implement the interface to determine if cloning
11 // possible at runtime. For example, this allows wrappers to check if
12 // their base stream supports cloning.
13 [infallible
] readonly attribute
boolean cloneable
;
15 // Produce a copy of the current stream in the most efficient way possible.
16 // In this case "copy" means that both the original and cloned streams
17 // should produce the same bytes for all future reads. Bytes that have
18 // already been consumed from the original stream are not copied to the
19 // clone. Operations on the two streams should be completely independent
20 // after the clone() occurs.
21 nsIInputStream clone
();
24 // This interface implements cloneWithRange() because for some streams
25 // (RemoteLazyInputStream only, so far) are more efficient to produce a sub
26 // stream with range than doing clone + SlicedInputStream().
27 [scriptable
, builtinclass
, uuid(ece853c3
-aded
-4cef
-8f51
-0d1493d60bd5
)]
28 interface nsICloneableInputStreamWithRange
: nsICloneableInputStream
30 nsIInputStream cloneWithRange
(in uint64_t start
, in uint64_t length
);