Skip to content

ReaderInput Methods

Functionality for reading binary data.

ReadByte

abstract
public abstract byte ReadByte()
Reads a byte from the input.

Returns

The byte which was read.

ReadBytes(Span<byte>)

abstract
public abstract void ReadBytes(Span<byte> destination)
Fills the destination span with data from the input.

Parameters

destinationSpan<byte>
The destination.

ReadBytes(byte[], int, int)

abstract
public abstract void ReadBytes(byte[] destination, int offset, int length)
Reads bytes from the input into the destination array.

Parameters

destinationbyte[]
The destination array.
offsetint
The offset into the destination to start writing bytes.
lengthint
The number of bytes to copy into destination.

ReadUInt32

abstract
public abstract uint ReadUInt32()
Reads a System.UInt32 from the input.

Returns

The System.UInt32 which was read.

ReadUInt64

abstract
public abstract ulong ReadUInt64()
Reads a System.UInt64 from the input.

Returns

The System.UInt64 which was read.

Seek(long)

abstract
public abstract void Seek(long position)
Seeks to the specified position.

Parameters

positionlong
The position.

Skip(long)

abstract
public abstract void Skip(long count)
Skips the specified number of bytes.

Parameters

countlong
The number of bytes to skip.

TryReadBytes(int, ReadOnlySpan<byte>)

abstract
public abstract bool TryReadBytes(int length, out ReadOnlySpan<byte> bytes)
Tries to read the specified number of bytes from the input.

Parameters

lengthint
The number of bytes to read..
bytesReadOnlySpan<byte>
The bytes which were read..

Returns

true if the number of bytes were successfully read, false otherwise.