# Reader&lt;TInput&gt; Methods

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

## ForkFrom(long, Reader&lt;TInput&gt;) {#forkfrom-long-out-orleans-serialization-buffers-reader-tinput-bce976d3}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.buffers.reader-1/methods/forkfrom-long-out-orleans-serialization-buffers-reader-tinput-bce976d3/)

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

```csharp
public void ForkFrom(long position, out Reader<TInput> forked)
```

Creates a new reader beginning at the specified position.

### Parameters

- `position` (`long`): The position in the input stream to fork from.
- `forked` (`Reader<TInput>`): The forked reader instance.

## PeekByte {#peekbyte-c69b5559}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.buffers.reader-1/methods/peekbyte-c69b5559/)

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

```csharp
public byte PeekByte()
```

Returns the next byte from the input without advancing the reader.

### Returns

The next byte in the input.

## ReadByte {#readbyte-c7180b1e}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.buffers.reader-1/methods/readbyte-c7180b1e/)

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

```csharp
public byte ReadByte()
```

Reads a byte from the input.

### Returns

The byte which was read.

## ReadBytes(uint) {#readbytes-uint-55963068}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.buffers.reader-1/methods/readbytes-uint-55963068/)

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

```csharp
public byte[] ReadBytes(uint count)
```

Reads an array of bytes from the input.

### Parameters

- `count` (`uint`): The length of the array to read.

### Returns

The array wihch was read.

## ReadBytes(Span&lt;byte&gt;) {#readbytes-system-span-byte-6cb27ef1}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.buffers.reader-1/methods/readbytes-system-span-byte-6cb27ef1/)

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

```csharp
public void ReadBytes(scoped Span<byte> destination)
```

Fills `destination` with bytes read from the input.

### Parameters

- `destination` (`Span<byte>`): The destination.

## ReadBytes(TBufferWriter, int) {#readbytes-1-ref-tbufferwriter-int-1e9e72d5}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.buffers.reader-1/methods/readbytes-1-ref-tbufferwriter-int-1e9e72d5/)

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

```csharp
public void ReadBytes<TBufferWriter>(scoped ref TBufferWriter writer, int count)
```

Reads the specified number of bytes into the provided writer.

### Parameters

- `writer` (`TBufferWriter`)
- `count` (`int`)

## ReadInt32 {#readint32-fa87a6bf}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.buffers.reader-1/methods/readint32-fa87a6bf/)

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

```csharp
public int ReadInt32()
```

Reads an `System.Int32` from the input.

### Returns

The `System.Int32` which was read.

## ReadInt64 {#readint64-843294f5}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.buffers.reader-1/methods/readint64-843294f5/)

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

```csharp
public long ReadInt64()
```

Reads a `System.Int64` from the input.

### Returns

The `System.Int64` which was read.

## ReadUInt32 {#readuint32-e4fe3033}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.buffers.reader-1/methods/readuint32-e4fe3033/)

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

```csharp
public uint ReadUInt32()
```

Reads a `System.UInt32` from the input.

### Returns

The `System.UInt32` which was read.

## ReadUInt64 {#readuint64-cbcee37d}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.buffers.reader-1/methods/readuint64-cbcee37d/)

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

```csharp
public ulong ReadUInt64()
```

Reads a `System.UInt64` from the input.

### Returns

The `System.UInt64` which was read.

## ReadVarUInt32 {#readvaruint32-bb49f30c}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.buffers.reader-1/methods/readvaruint32-bb49f30c/)

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

```csharp
public uint ReadVarUInt32()
```

Reads a variable-width `System.UInt32` from the input.

### Returns

The `System.UInt32` which was read.

## ReadVarUInt64 {#readvaruint64-9c361d24}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.buffers.reader-1/methods/readvaruint64-9c361d24/)

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

```csharp
public ulong ReadVarUInt64()
```

Reads a variable-width `System.UInt64` from the input.

### Returns

The `System.UInt64` which was read.

## ResumeFrom(long) {#resumefrom-long-5a228258}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.buffers.reader-1/methods/resumefrom-long-5a228258/)

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

```csharp
public void ResumeFrom(long position)
```

Resumes the reader from the specified position after forked readers are no longer in use.

### Parameters

- `position` (`long`): The position to resume reading from.

## Skip(long) {#skip-long-9be569dc}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.buffers.reader-1/methods/skip-long-9be569dc/)

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

```csharp
public void Skip(long count)
```

Skips the specified number of bytes.

### Parameters

- `count` (`long`): The number of bytes to skip.

## TryReadBytes(int, ReadOnlySpan&lt;byte&gt;) {#tryreadbytes-int-out-system-readonlyspan-byte-ed193280}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.serialization/orleans.serialization.buffers.reader-1/methods/tryreadbytes-int-out-system-readonlyspan-byte-ed193280/)

[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.
