Documentation API reference Microsoft.Orleans.Serialization ArcBufferWriter Methods Markdown A System.Buffers.IBufferWriter implementation implemented using pooled arrays which is specialized for creating System.Buffers.ReadOnlySequence instances.
View source public void AdvanceReader ( int count)
Advances the reader by the specified number of bytes.
Parameters
countint The number of bytes to advance the reader. View source public void AdvanceWriter ( int count)
Advances the writer by the specified number of bytes.
Parameters
countint The numbers of bytes to advance the writer by. View source public void AppendPinned (ArcBuffer input)
Appends the pages referenced by input directly to this writer by pinning them.
Parameters
inputArcBuffer The buffer to append. View source public ArcBuffer ConsumeSlice ( int count)
Consumes a slice of the provided length.
Parameters
countint The number of bytes to consume. Returns A pinned buffer representing the consumed data. The caller owns the returned buffer and must dispose it.
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 public ReadOnlySpan< byte > Peek (scoped in Span< byte > destination)
Attempts to read the provided number of bytes from the buffer.
Parameters
destinationSpan<byte> The destination, which may be used to hold the requested data if the data needs to be copied. Returns A span of either zero length, if the data is unavailable, or at least the requested length if the data is available.
View source public int Peek (Span< byte > output)
Copies the contents of this writer to a span.
Parameters
outputSpan<byte> View source public ArcBuffer PeekSlice ( int count)
Returns a pinned slice of the provided length without marking the data referred to it as consumed.
Parameters
countint The number of bytes to consume. Returns A pinned slice of unconsumed data. The caller owns the returned buffer and must dispose it.
View source public void ReplenishBuffers (List<ArraySegment< byte >> buffers)
Adds additional buffers to the destination list until the list has reached its capacity.
Parameters
buffersList<ArraySegment<byte>> The destination to add buffers to. View source Resets this instance, returning all memory.
View source public void Truncate ( int length)
Truncates this buffer to the specified unconsumed length.
Parameters
lengthint The new length of the unconsumed bytes. 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. View source public void WriteAt ( int offset, ReadOnlySpan< byte > value)
Overwrites bytes which have already been written to this buffer without changing the writer position.
Parameters
offsetint The offset into the unconsumed bytes at which to start writing.
valueReadOnlySpan<byte> The bytes to write.