FileStream.SetLength Method

May 11, 2014

Sets the length of this stream to the given value.

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)

public override void SetLength(
	long value
)

Parameters

value
Type: System.Int64
The new length of the stream.

ExceptionCondition
IOException

An I/O error has occurred.

NotSupportedException

The stream does not support both writing and seeking.

ArgumentOutOfRangeException

Attempted to set the value parameter to less than 0.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft