Documentation API reference Microsoft.Orleans.Serialization PooledBuffer Methods Markdown A System.Buffers.IBufferWriter implementation implemented using pooled arrays which is specialized for creating System.Buffers.ReadOnlySequence instances.
View source public void Advance ( int bytes)
Notifies the System.Buffers.IBufferWriter that count data items were written to the output System.Span or System.Memory.
Parameters
bytesint The number of data items written to the System.Span or System.Memory. View source public ReadOnlySequence< byte > AsReadOnlySequence ()
Returns a new System.Buffers.ReadOnlySequence which must not be accessed after disposing this instance.
View source public readonly void CopyTo (Span< byte > output)
Copies the contents of this writer to a span.
Parameters
outputSpan<byte> View source public readonly void CopyTo <TBufferWriter>( ref TBufferWriter writer)
Copies the contents of this writer to another writer.
Parameters
writerTBufferWriter View source public readonly void CopyTo <TBufferWriter>( ref Writer<TBufferWriter> writer)
Copies the contents of this writer to another writer.
Parameters
writerWriter<TBufferWriter> View source Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
View source public Memory< byte > GetMemory ( int sizeHint = 0 )
Returns a System.Memory to write to that is at least the requested size (specified by sizeHint).
Parameters
sizeHintint The minimum length of the returned System.Memory. If 0, a non-empty buffer is returned. Returns A System.Memory of at least the size sizeHint. If sizeHint is 0, returns a non-empty buffer.
Exceptions
System.OutOfMemoryExceptionThe requested buffer size is not available. View source public Span< byte > GetSpan ( int sizeHint = 0 )
Returns a System.Span to write to that is at least the requested size (specified by sizeHint).
Parameters
sizeHintint The minimum length of the returned System.Span. If 0, a non-empty buffer is returned. Returns A System.Span of at least the size sizeHint. If sizeHint is 0, returns a non-empty buffer.
View source Resets this instance, returning all memory.
View source public readonly BufferSlice Slice ()
View source public readonly BufferSlice Slice ( int offset)
Returns a slice of this buffer, beginning at the specified offset.
Returns A slice representing a subset of this instance, beginning at the specified offset.
View source public readonly BufferSlice Slice ( int offset, int length)
Returns a slice of this buffer, beginning at the specified offset and having the specified length.
Parameters
offsetint
lengthint Returns A slice representing a subset of this instance, beginning at the specified offset.
View source public readonly byte [] ToArray ()
Returns the data which has been written as an array.
Returns The data which has been written.
View source public void Write (ReadOnlySequence< byte > input)
Writes the provided sequence to this buffer.
Parameters
inputReadOnlySequence<byte> The data to write. View source public void Write (ReadOnlySpan< byte > value)
Writes the provided value to this buffer.
Parameters
valueReadOnlySpan<byte> The data to write.