Table of Contents
API reference

Method Read

Namespace
DisCatSharp.Common.Types
Assembly
DisCatSharp.Common.dll

Read(Span<T>, ulong, out int)

Reads data from this buffer to the specified destination buffer. This method will write either as many bytes as there are in the destination buffer, or however many bytes are available in this buffer, whichever is less.

public bool Read(Span<T> destination, ulong source, out int itemsWritten)

Parameters

destination Span<T>

Buffer to read the data from this buffer into.

source ulong

Starting position in this buffer to read from.

itemsWritten int

Number of items written to the destination buffer.

Returns

bool

Whether more data is available in this buffer.

Read(T[], int, int, ulong, out int)

Reads data from this buffer to specified destination array. This method will write either as many bytes as specified for the destination array, or however many bytes are available in this buffer, whichever is less.

public bool Read(T[] data, int start, int count, ulong source, out int itemsWritten)

Parameters

data T[]

Array to read the data from this buffer into.

start int

Starting position in the target array to write to.

count int

Maximum number of bytes to write to target array.

source ulong

Starting position in this buffer to read from.

itemsWritten int

Number of items written to the destination buffer.

Returns

bool

Whether more data is available in this buffer.

Read(ArraySegment<T>, ulong, out int)

Reads data from this buffer to specified destination array slice. This method will write either as many bytes as specified in the target slice, or however many bytes are available in this buffer, whichever is less.

public bool Read(ArraySegment<T> data, ulong source, out int itemsWritten)

Parameters

data ArraySegment<T>
source ulong
itemsWritten int

Number of items written to the destination buffer.

Returns

bool

Whether more data is available in this buffer.