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 );
Exception Type | Condition |
---|---|
IOException | An I/O error occurs. |
NotSupportedException | The stream does not support both writing and seeking. |
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.