Mono Class Library: System.IO.MemoryStream Overview | Members

System.IO.MemoryStream Constructor

Constructs and initializes a new resizable instance of the System.IO.MemoryStream class. [Edit]

public MemoryStream (int capacity)

Parameters

capacity
A int that specifies the initial size of the internal byte array. [Edit]

Exceptions

TypeReason
ArgumentOutOfRangeExceptioncapacity is negative. [Edit]

Remarks

The Stream.CanRead, Stream.CanSeek, and Stream.CanWrite properties of the new instance of the System.IO.MemoryStream class are set to true.

The MemoryStream.Capacity of the new stream instance is set to capacity can be increased by using the MemoryStream.SetLength(long) method or by setting the MemoryStream.Capacity property. Write operations at the end of the new instance of the System.IO.MemoryStream class expand the System.IO.MemoryStream.

The new stream exposes the underlying byte buffer, which can be accessed through the MemoryStream.GetBuffer method.

[Edit]

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0