PooledBuffer Struct
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A IBufferWriter<T> implementation implemented using pooled arrays which is specialized for creating ReadOnlySequence<T> instances.
[Orleans.Immutable]
public struct PooledBuffer : IDisposable, System.Buffers.IBufferWriter<byte>
[<Orleans.Immutable>]
type PooledBuffer = struct
interface IBufferWriter<byte>
interface IDisposable
Public Structure PooledBuffer
Implements IBufferWriter(Of Byte), IDisposable
- Inheritance
-
PooledBuffer
- Attributes
- Implements
Constructors
PooledBuffer() |
Initializes a new instance of the PooledBuffer struct. |
Properties
Length |
Gets the total length which has been written. |
Methods
Advance(Int32) | Notifies the IBufferWriter<T> that |
AsReadOnlySequence() |
Returns a new ReadOnlySequence<T> which must not be accessed after disposing this instance. |
CopyTo(Span<Byte>) |
Copies the contents of this writer to a span. |
CopyTo<TBufferWriter>(TBufferWriter) |
Copies the contents of this writer to another writer. |
CopyTo<TBufferWriter>(Writer<TBufferWriter>) |
Copies the contents of this writer to another writer. |
Dispose() | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
GetEnumerator() |
Returns an enumerator which can be used to enumerate the data referenced by this instance. |
GetMemory(Int32) | Returns a Memory<T> to write to that is at least the requested size (specified by |
GetSpan(Int32) | Returns a Span<T> to write to that is at least the requested size (specified by |
Reset() |
Resets this instance, returning all memory. |
Slice() |
Returns a PooledBuffer.BufferSlice covering this entire buffer. |
Slice(Int32, Int32) |
Returns a slice of this buffer, beginning at the specified offset and having the specified length. |
Slice(Int32) |
Returns a slice of this buffer, beginning at the specified offset. |
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. |