Edytuj

Udostępnij za pośrednictwem


Writer<TBufferWriter> Struct

Definition

Provides functionality for writing to an output stream.

public ref struct Writer<TBufferWriter> where TBufferWriter : IBufferWriter<byte>
type Writer<'BufferWriter (requires 'BufferWriter :> IBufferWriter<byte>)> = struct
Public Structure Writer(Of TBufferWriter)

Type Parameters

TBufferWriter

The underlying buffer writer type.

Inheritance
Writer<TBufferWriter>

Fields

Output

The output buffer writer.

Properties

Position

Gets the position.

Session

Gets the serializer session.

WritableSpan

Gets the current writable span.

Methods

AdvanceSpan(Int32)

Advance the write position in the current span.

Allocate(Int32)

Allocates buffer space for the specified number of bytes.

Commit()

Commit the currently written buffers.

Dispose() System.ValueType.Dispose
EnsureContiguous(Int32)

Ensures that there are at least length contiguous bytes available to be written.

Write(ReadOnlySpan<Byte>)

Writes the specified value.

WriteByte(Byte)

Writes the provided Byte to the output buffer.

WriteEndBase()

Writes the end base tag.

WriteEndObject()

Writes the end object tag.

WriteFieldHeader(UInt32, Type, Type, WireType)

Writes the field header.

WriteFieldHeaderExpected(UInt32, WireType)

Writes an expected field header value.

WriteInt32(Int32)

Writes the provided Int32 to the output buffer.

WriteInt64(Int64)

Writes the provided Int64 to the output buffer.

WriteStartObject(UInt32, Type, Type)

Writes the start object tag.

WriteUInt32(UInt32)

Writes the provided UInt32 to the output buffer.

WriteUInt64(UInt64)

Writes the provided UInt64 to the output buffer.

WriteVarInt16(Int16)

Writes a variable-width Int16.

WriteVarInt32(Int32)

Writes a variable-width Int32.

WriteVarInt64(Int64)

Writes a variable-width Int64.

WriteVarInt8(SByte)

Writes a variable-width SByte.

WriteVarUInt16(UInt16)

Writes a variable-width UInt16.

WriteVarUInt32(UInt32)

Writes the provided UInt32 to the output buffer as a variable-width integer.

WriteVarUInt64(UInt64)

Writes the provided UInt64 to the output buffer as a variable-width integer.

WriteVarUInt8(Byte)

Writes a variable-width Byte.

Extension Methods

SerializeUnexpectedType<TBufferWriter>(Writer<TBufferWriter>, UInt32, Type, Object)

Serializes an unexpected value.

Applies to