PrefixingBufferWriter<T,TBufferWriter> Class
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.
An IBufferWriter<T> that reserves some fixed size for a header.
public class PrefixingBufferWriter<T,TBufferWriter> : System.Buffers.IBufferWriter<T> where TBufferWriter : IBufferWriter<T>
type PrefixingBufferWriter<'T, 'BufferWriter (requires 'BufferWriter :> IBufferWriter<'T>)> = class
interface IBufferWriter<'T>
Public Class PrefixingBufferWriter(Of T, TBufferWriter)
Implements IBufferWriter(Of T)
Type Parameters
- T
The type of element written by this writer.
- TBufferWriter
The type of underlying buffer writer.
- Inheritance
-
PrefixingBufferWriter<T,TBufferWriter>
- Implements
Remarks
This type is used for inserting the length of list in the header when the length is not known beforehand. It is optimized to minimize or avoid copying.
Constructors
PrefixingBufferWriter<T,TBufferWriter>(Int32, Int32, MemoryPool<T>) |
Initializes a new instance of the PrefixingBufferWriter<T,TBufferWriter> class. |
Properties
CommittedBytes |
Methods
Advance(Int32) | Notifies the IBufferWriter<T> that |
Complete(ReadOnlySpan<T>) |
Inserts the prefix and commits the payload to the underlying IBufferWriter<T>. |
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(TBufferWriter) |
Resets this instance to a reusable state. |