When overridden in a derived class, sets the length of the current stream.

Namespace: Contracts
Assembly: Contracts (in Contracts.dll)

Public Overrides Sub SetLength( _ 
ByVal value As Long
)
This language is not supported or no code example is available.
public override void SetLength( 
long value 
)
This language is not supported or no code example is available.
public:  
void SetLength( 
long value 
)
This language is not supported or no code example is available.
public function SetLength( 
value : long 
);
This language is not supported or no code example is available.

Parameters

value
Type: long

The desired length of the current stream in bytes.

Exception type Condition

IOException

An I/O error occurs.

ObjectDisposedException

Methods were called after the stream was closed.

NotSupportedException

The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output.

.NET Framework

Supported in: 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1