Skip to content

ArcBuffer Methods

Represents a slice of a ArcBufferWriter.

AsReadOnlySequence

View source
public readonly ReadOnlySequence<byte> AsReadOnlySequence()
Returns a new System.Buffers.ReadOnlySequence which must not be accessed after disposing this instance.

CopyTo(Span<byte>)

View source
public readonly int CopyTo(Span<byte> output)
Copies the contents of this writer to a span.

Parameters

outputSpan<byte>

CopyTo(ArcBufferWriter)

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

Parameters

outputArcBufferWriter

CopyTo(TBufferWriter)

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

Parameters

outputTBufferWriter

Dispose

View source
public void Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

GetEnumerator

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

Returns

An enumerator for the data contained in this instance.

Pin

View source
public readonly void Pin()
Pins this slice, preventing the referenced pages from being returned to the pool.

Slice(int)

View source
public readonly ArcBuffer Slice(int offset)
Creates a pinned slice from the specified offset to the end of this buffer.

Parameters

offsetint
The zero-based offset at which the slice begins.

Returns

A pinned slice which must be disposed when it is no longer needed.

Slice(int, int)

View source
public readonly ArcBuffer Slice(int offset, int length)
Creates a pinned slice of the specified length.

Parameters

offsetint
The zero-based offset at which the slice begins.
lengthint
The length of the slice.

Returns

A pinned slice which must be disposed when it is no longer needed.

ToArray

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

Returns

The data which has been written.

Unpin

View source
public void Unpin()
Unpins this slice, allowing the referenced pages to be returned to the pool.

UnsafeSlice(int, int)

View source
public readonly ArcBuffer UnsafeSlice(int offset, int length)
Creates a slice whose lifetime is bounded by this buffer.

Parameters

offsetint
The zero-based offset at which the slice begins.
lengthint
The length of the slice.

Returns

An unpinned slice which remains valid while this buffer keeps the referenced pages pinned.