Skip to content

PooledBuffer

struct

Namespace: Orleans.Serialization.Buffers

A System.Buffers.IBufferWriter implementation implemented using pooled arrays which is specialized for creating System.Buffers.ReadOnlySequence instances.
[Orleans.Immutable]
public struct PooledBuffer : IBufferWriter<byte>, IDisposable

Constructors

Properties

  • LengthGets the total length which has been written.
  • MemorySegments Returns an enumerator which can be used to enumerate the data referenced by this instance.

Methods

  • Advance(int)Notifies the System.Buffers.IBufferWriter that count data items were written to the output System.Span or System.Memory.
  • 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(TBufferWriter)Copies the contents of this writer to another writer.
  • CopyTo(Writer<TBufferWriter>)Copies the contents of this writer to another writer.
  • DisposePerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
  • GetMemory(int)Returns a System.Memory to write to that is at least the requested size (specified by sizeHint).
  • GetSpan(int)Returns a System.Span to write to that is at least the requested size (specified by sizeHint).
  • Reset Resets this instance, returning all memory.
  • Slice Returns a BufferSlice covering this entire buffer.
  • Slice(int) Returns a slice of this buffer, beginning at the specified offset.
  • Slice(int, int) Returns a slice of this buffer, beginning at the specified offset and having the specified length.
  • ToArray Returns the data which has been written as an array.
  • Write(ReadOnlySequence<byte>) Writes the provided sequence to this buffer.
  • Write(ReadOnlySpan<byte>) Writes the provided value to this buffer.