An input buffer customised for use by InflaterInputStream
The buffer supports decryption of incoming data.
 public InflaterInputStream(Stream baseInputStream, Inflater inflater, int bufferSize)
 {
     this.isStreamOwner = true;
     if (baseInputStream == null)
     {
         throw new ArgumentNullException("baseInputStream");
     }
     if (inflater == null)
     {
         throw new ArgumentNullException("inflater");
     }
     if (bufferSize <= 0)
     {
         throw new ArgumentOutOfRangeException("bufferSize");
     }
     this.baseInputStream = baseInputStream;
     this.inf = inflater;
     this.inputBuffer = new InflaterInputBuffer(baseInputStream, bufferSize);
 }
Esempio n. 2
0
        /// <summary>
        /// Create an InflaterInputStream with the specified decompressor
        /// and the specified buffer size.
        /// </summary>
        /// <param name = "baseInputStream">
        /// The InputStream to read bytes from
        /// </param>
        /// <param name = "inflater">
        /// The decompressor to use
        /// </param>
        /// <param name = "bufferSize">
        /// Size of the buffer to use
        /// </param>
        public InflaterInputStream(Stream baseInputStream, Inflater inflater, int bufferSize)
        {
            if (baseInputStream == null)
            {
                throw new ArgumentNullException("baseInputStream");
            }

            if (inflater == null)
            {
                throw new ArgumentNullException("inflater");
            }

            if (bufferSize <= 0)
            {
                throw new ArgumentOutOfRangeException("bufferSize");
            }

            this.baseInputStream = baseInputStream;
            this.inf             = inflater;

            inputBuffer = new InflaterInputBuffer(baseInputStream, bufferSize);
        }
Esempio n. 3
0
        /// <summary>
        /// Create an InflaterInputStream with the specified decompressor
        /// and the specified buffer size.
        /// </summary>
        /// <param name = "baseInputStream">
        /// The InputStream to read bytes from
        /// </param>
        /// <param name = "inflater">
        /// The decompressor to use
        /// </param>
        /// <param name = "bufferSize">
        /// Size of the buffer to use
        /// </param>
        public InflaterInputStream(Stream baseInputStream, Inflater inflater, int bufferSize)
        {
            IsStreamOwner = true;
            if (baseInputStream == null)
            {
                throw new ArgumentNullException(SerialportSample.XWUtils.nameof(baseInputStream));
            }

            if (inflater == null)
            {
                throw new ArgumentNullException(SerialportSample.XWUtils.nameof(inflater));
            }

            if (bufferSize <= 0)
            {
                throw new ArgumentOutOfRangeException(SerialportSample.XWUtils.nameof(bufferSize));
            }

            this.baseInputStream = baseInputStream;
            this.inf             = inflater;

            inputBuffer = new InflaterInputBuffer(baseInputStream, bufferSize);
        }
        /// <summary>
        /// Create an InflaterInputStream with the specified decompressor
        /// and the specified buffer size.
        /// </summary>
        /// <param name = "baseInputStream">
        /// The InputStream to read bytes from
        /// </param>
        /// <param name = "inflater">
        /// The decompressor to use
        /// </param>
        /// <param name = "bufferSize">
        /// Size of the buffer to use
        /// </param>
        public InflaterInputStream(Stream baseInputStream, Inflater inflater, int bufferSize)
        {
            if (baseInputStream == null) {
                throw new ArgumentNullException(nameof(baseInputStream));
            }

            if (inflater == null) {
                throw new ArgumentNullException(nameof(inflater));
            }

            if (bufferSize <= 0) {
                throw new ArgumentOutOfRangeException(nameof(bufferSize));
            }

            this.baseInputStream = baseInputStream;
            this.inf = inflater;

            inputBuffer = new InflaterInputBuffer(baseInputStream, bufferSize);
        }