1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/base/public/nsIBufferedStreams.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,37 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#include "nsIInputStream.idl" 1.9 +#include "nsIOutputStream.idl" 1.10 + 1.11 +/** 1.12 + * An input stream that reads ahead and keeps a buffer coming from another input 1.13 + * stream so that fewer accesses to the underlying stream are necessary. 1.14 + */ 1.15 +[scriptable, uuid(616f5b48-da09-11d3-8cda-0060b0fc14a3)] 1.16 +interface nsIBufferedInputStream : nsIInputStream 1.17 +{ 1.18 + /** 1.19 + * @param fillFromStream - add buffering to this stream 1.20 + * @param bufferSize - specifies the maximum buffer size 1.21 + */ 1.22 + void init(in nsIInputStream fillFromStream, 1.23 + in unsigned long bufferSize); 1.24 +}; 1.25 + 1.26 +/** 1.27 + * An output stream that stores up data to write out to another output stream 1.28 + * and does the entire write only when the buffer is full, so that fewer writes 1.29 + * to the underlying output stream are necessary. 1.30 + */ 1.31 +[scriptable, uuid(6476378a-da09-11d3-8cda-0060b0fc14a3)] 1.32 +interface nsIBufferedOutputStream : nsIOutputStream 1.33 +{ 1.34 + /** 1.35 + * @param sinkToStream - add buffering to this stream 1.36 + * @param bufferSize - specifies the maximum buffer size 1.37 + */ 1.38 + void init(in nsIOutputStream sinkToStream, 1.39 + in unsigned long bufferSize); 1.40 +};