# PooledBufferStream.SetLength(long)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.buffers.adaptors.pooledbufferstream/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.buffers.adaptors.pooledbufferstream/methods/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Buffers/Adaptors/PooledBufferStream.cs#L232-L281)

```csharp
public override void SetLength(long value)
```

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

### Parameters

- `value` (`long`): The desired length of the current stream in bytes.

### Exceptions

- `System.IO.IOException`: An I/O error occurs.
- `System.NotSupportedException`: The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output.
- `System.ObjectDisposedException`: Methods were called after the stream was closed.
