# Reader&lt;TInput&gt;.TryReadBytes(int, ReadOnlySpan&lt;byte&gt;)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.buffers.reader-1/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.buffers.reader-1/methods/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Serialization/Buffers/Reader.cs#L954-L973)

```csharp
public bool TryReadBytes(int length, out ReadOnlySpan<byte> bytes)
```

Tries the read the specified number of bytes from the input.

### Parameters

- `length` (`int`): The length.
- `bytes` (`ReadOnlySpan<byte>`): The bytes which were read.

### Returns

`true` if the specified number of bytes were read from the input, `false` otherwise.
