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

MemoryStream() public method

public MemoryStream ( int capacity ) : System.Threading
capacity int
return System.Threading
        public MemoryStream(int capacity)
        {
            if (capacity < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(capacity), SR.ArgumentOutOfRange_NegativeCapacity);
            }

            _buffer = capacity != 0 ? new byte[capacity] : Array.Empty<byte>();
            _capacity = capacity;
            _expandable = true;
            _writable = true;
            _exposable = true;
            _origin = 0;      // Must be 0 for byte[]'s created by MemoryStream
            _isOpen = true;
        }

Same methods

MemoryStream::MemoryStream ( ) : System.Threading
MemoryStream::MemoryStream ( byte buffer ) : System.Threading
MemoryStream::MemoryStream ( byte buffer, bool writable ) : System.Threading
MemoryStream::MemoryStream ( byte buffer, int index, int count ) : System.Threading
MemoryStream::MemoryStream ( byte buffer, int index, int count, bool writable ) : System.Threading
MemoryStream::MemoryStream ( byte buffer, int index, int count, bool writable, bool publiclyVisible ) : System.Threading