1 #include "nsIInputStream.idl"
2 #include "nsIOutputStream.idl"
3
4 /**
5 * An input stream that reads ahead and keeps a buffer coming from another input
6 * stream so that fewer accesses to the underlying stream are necessary.
7 */
8 [scriptable, uuid(616f5b48-da09-11d3-8cda-0060b0fc14a3)]
9 interface nsIBufferedInputStream : nsIInputStream
10 {
11 /**
12 * @param fillFromStream - add buffering to this stream
13 * @param bufferSize - specifies the maximum buffer size
14 */
15 void init(in nsIInputStream fillFromStream,
16 in unsigned long bufferSize);
17 };
18
19 /**
20 * An output stream that stores up data to write out to another output stream
21 * and does the entire write only when the buffer is full, so that fewer writes
22 * to the underlying output stream are necessary.
23 */
24 [scriptable, uuid(6476378a-da09-11d3-8cda-0060b0fc14a3)]
25 interface nsIBufferedOutputStream : nsIOutputStream
26 {
27 /**
28 * @param sinkToStream - add buffering to this stream
29 * @param bufferSize - specifies the maximum buffer size
30 */
31 void init(in nsIOutputStream sinkToStream,
32 in unsigned long bufferSize);
33 };