System.IO.BufferedStream.BufferedStream C# (CSharp) Method

BufferedStream() public method

public BufferedStream ( Stream stream, int bufferSize ) : System.Runtime.InteropServices
stream Stream
bufferSize int
return System.Runtime.InteropServices
        public BufferedStream(Stream stream, int bufferSize)
        {
            if (stream == null)
                throw new ArgumentNullException(nameof(stream));

            if (bufferSize <= 0)
                throw new ArgumentOutOfRangeException(nameof(bufferSize), SR.Format(SR.ArgumentOutOfRange_MustBePositive, nameof(bufferSize)));

            _stream = stream;
            _bufferSize = bufferSize;

            // Allocate _buffer on its first use - it will not be used if all reads
            // & writes are greater than or equal to buffer size.

            if (!_stream.CanRead && !_stream.CanWrite)
                throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed);
        }

Same methods

BufferedStream::BufferedStream ( Stream stream ) : System.Runtime.InteropServices