NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

FileStream.SetLength

Sets the length of this stream to the given value.

[Visual Basic]
Overrides Public Sub SetLength( _
   ByVal value As Long _
)
[C#]
public override void SetLength(
   long value
);
[C++]
public: override void SetLength(
   __int64 value
);
[JScript]
public override function SetLength(
   value : long
);

Parameters

value
The new length of the stream.

Exceptions

Exception Type Condition
IOException An I/O error occurs.
NotSupportedException The stream does not support both writing and seeking.

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 length are undefined. A stream must support both writing and seeking to implement SetLength.

See Also

FileStream Class | FileStream Members | System.IO Namespace