tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

nsIBufferedStreams.idl (1555B)


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