Mono Class Library: System.IO.MemoryStream Overview | MembersSystem.IO.MemoryStream.Capacity Property |
Gets or sets the number of bytes allocated for the current stream. [Edit]
|
A int containing the number of bytes allocated for the current stream. [Edit]
Type Reason ArgumentOutOfRangeException The value specified for a set operation is negative or less than the current length of the stream. [Edit] NotSupportedException A set operation was attempted on a stream whose capacity cannot be modified. [Edit] ObjectDisposedException The current stream is closed. [Edit]
MemoryStream.Capacity is the buffer length for system-provided byte arrays. If the current stream is created with a specified byte array, MemoryStream.Capacity indicates the length of the portion of the provided array to which the current stream has access.
MemoryStream.Capacity cannot be set to a value less than the current length of the stream, but can be set to less than the current capacity. If the capacity specified is less than the current capacity, the size of the buffer used to hold the stream can be reduced, but need not be.
Note: If the value specified for a set operation is less than the default value, for performance reasons the property is set to the default. The default value of the MemoryStream.Capacity property is unspecified.Operation
As described above. [Edit]
Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0