Skip to content

ArcBuffer

struct

Namespace: Orleans.Serialization.Buffers

Represents a reference-counted slice of raw bytes from an ArcBufferWriter.
public struct ArcBuffer : IDisposable

Remarks

An owned slice must be disposed when no longer needed. Copying this struct creates a borrowed view whose lifetime is bounded by the owner. Use ArcBuffer to obtain an independent owner. Referenced bytes must remain unchanged while a slice is in use. The default value is a valid, owner-free empty buffer.

Constructors

Properties

  • ArraySegments Returns an enumerator which can be used to enumerate the array segments referenced by this instance.
  • EmptyGets an empty buffer which owns no pages.
  • IsEmptyGets whether this buffer contains no bytes.
  • MemorySegments Returns an enumerator which can be used to enumerate the memory segments referenced by this instance.
  • SpanSegments Returns an enumerator which can be used to enumerate the span segments referenced by this instance.

Methods

  • AsReadOnlySequence Returns a new System.Buffers.ReadOnlySequence which must not be accessed after disposing this instance.
  • CopyTo(Span<byte>)Copies the contents of this writer to a span.
  • CopyTo(ArcBufferWriter)Copies the contents of this writer to a pooled buffer.
  • CopyTo(TBufferWriter)Copies the contents of this writer to a buffer writer.
  • DisposePerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
  • GetEnumerator Returns an enumerator which can be used to enumerate the span segments referenced by this instance.
  • Pin Pins this slice, preventing the referenced pages from being returned to the pool.
  • Slice(int) Creates a pinned slice from the specified offset to the end of this buffer.
  • Slice(int, int) Creates a pinned slice of the specified length.
  • ToArray Returns the data which has been written as an array.
  • Unpin Unpins this slice, allowing the referenced pages to be returned to the pool.
  • UnsafeSlice(int, int) Creates a slice whose lifetime is bounded by this buffer.

Fields

  • First Gets the first page, or null for an owner-free empty buffer.
  • Length Gets the length of this sequence.
  • Offset Gets the offset into the first page at which this slice begins.