# PooledBufferStream.Write(byte[], int, int)

[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#L294-L327)

```csharp
public override void Write(byte[] buffer, int offset, int count)
```

When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

### Parameters

- `buffer` (`byte[]`): An array of bytes. This method copies `count` bytes from `buffer` to the current stream.
- `offset` (`int`): The zero-based byte offset in `buffer` at which to begin copying bytes to the current stream.
- `count` (`int`): The number of bytes to be written to the current stream.

### Exceptions

- `System.ArgumentException`: The sum of `offset` and `count` is greater than the buffer length.
- `System.ArgumentNullException`: `buffer` is `null`.
- `System.ArgumentOutOfRangeException`: `offset` or `count` is negative.
- `System.IO.IOException`: An I/O error occurred, such as the specified file cannot be found.
- `System.NotSupportedException`: The stream does not support writing.
- `System.ObjectDisposedException`: `System.IO.Stream.Write(System.Byte[],System.Int32,System.Int32)` was called after the stream was closed.
