Skip to content

BufferSlice Methods

Represents a slice of a PooledBuffer.

CopyTo(PooledBuffer)

View source
public void CopyTo(ref PooledBuffer output)
Copies the contents of this writer to a pooled buffer.

Parameters

outputPooledBuffer

CopyTo(TBufferWriter)

View source
public void CopyTo<TBufferWriter>(ref TBufferWriter output)
Copies the contents of this writer to a buffer writer.

Parameters

outputTBufferWriter

GetEnumerator

View source
public SpanEnumerator GetEnumerator()
Returns an enumerator which can be used to enumerate the data referenced by this instance.

Returns

An enumerator for the data contained in this instance.

Slice(int)

View source
public BufferSlice Slice(int offset)
Forms a slice out of this instance, beginning at the specified offset into this slice.

Parameters

offsetint
The offset into this slice where the newly formed slice will begin.

Returns

A slice instance.

Slice(int, int)

View source
public BufferSlice Slice(int offset, int length)
Forms a slice out of this instance, beginning at the specified offset into this slice and having the specified length.

Parameters

offsetint
The offset into this slice where the newly formed slice will begin.
lengthint
The length of the new slice.

Returns

A slice instance.

ToArray

View source
public byte[] ToArray()
Returns the data which has been written as an array.

Returns

The data which has been written.