Skip to content

ArcBufferReader Methods

Provides reader access to an ArcBufferWriter.

ConsumeSlice(int)

View source
public ArcBuffer ConsumeSlice(int count)
Consumes a slice of the provided length.

Parameters

countint
The number of bytes to consume.

Returns

A buffer representing the consumed data.

Peek(Span<byte>)

View source
public ReadOnlySpan<byte> Peek(scoped in Span<byte> destination)
Attempts to read the provided number of bytes from the buffer.

Parameters

destinationSpan<byte>
The destination, which may be used to hold the requested data if the data needs to be copied.

Returns

A span of either zero length, if the data is unavailable, or the requested length if the data is available.

Peek(long)

View source
public byte Peek(long offset)
Peeks at a byte at the specified offset into the unread data.

Parameters

offsetlong

PeekSlice(int)

View source
public ArcBuffer PeekSlice(int count)
Returns a slice of the provided length without marking the data referred to it as consumed.

Parameters

countint
The number of bytes to consume.

Returns

A slice of unconsumed data.

TryReadTo(ArcBuffer, byte, bool)

View source
public bool TryReadTo(out ArcBuffer slice, byte delimiter, bool advancePastDelimiter = true)
Reads through the next occurrence of delimiter.

Parameters

sliceArcBuffer
delimiterbyte
advancePastDelimiterbool