System.IO.UnmanagedMemoryStream.SetLength Method

Sets the length of a stream to a specified value.

Syntax

public override void SetLength (long value)

Parameters

value
The length of the stream.

Remarks

If the given value is less than the current length of the stream, the stream is truncated. If the given value is larger than the current length of the stream, the stream is expanded. If the stream is expanded, the contents of the stream between the old and the new lengths are undefined.

A stream must support both writing and seeking for UnmanagedMemoryStream.SetLength(long) to work.

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0