Skip to content

Writer<TBufferWriter> Methods

Provides functionality for writing to an output stream.

AdvanceSpan(int)

View source
public void AdvanceSpan(int length)
Advance the write position in the current span.

Parameters

lengthint
The number of bytes to advance wirte position by.

Allocate(int)

View source
public void Allocate(int sizeHint)
Allocates buffer space for the specified number of bytes.

Parameters

sizeHintint
The number of bytes to reserve.

EnsureContiguous(int)

View source
public void EnsureContiguous(int length)
Ensures that there are at least length contiguous bytes available to be written.

Parameters

lengthint
The number of contiguous bytes to ensure.

WriteByte(byte)

View source
public void WriteByte(byte value)
Writes the provided System.Byte to the output buffer.

Parameters

valuebyte
The value.

WriteFieldHeader(uint, Type, Type, WireType)

View source
public void WriteFieldHeader(uint fieldId, Type expectedType, Type actualType, WireType wireType)
Writes the field header.

Parameters

fieldIduint
The field identifier.
expectedTypeType
The expected type.
actualTypeType
The actual type.
wireTypeWireType
The wire type.

WriteInt32(int)

View source
public void WriteInt32(int value)
Writes the provided System.Int32 to the output buffer.

Parameters

valueint
The value.

WriteInt64(long)

View source
public void WriteInt64(long value)
Writes the provided System.Int64 to the output buffer.

Parameters

valuelong
The value.

WriteStartObject(uint, Type, Type)

View source
public void WriteStartObject(uint fieldId, Type expectedType, Type actualType)
Writes the start object tag.

Parameters

fieldIduint
The field identifier.
expectedTypeType
The expected type.
actualTypeType
The actual type.

WriteUInt32(uint)

View source
public void WriteUInt32(uint value)
Writes the provided System.UInt32 to the output buffer.

Parameters

valueuint
The value.

WriteUInt64(ulong)

View source
public void WriteUInt64(ulong value)
Writes the provided System.UInt64 to the output buffer.

Parameters

valueulong
The value.

WriteVarUInt32(uint)

View source
public void WriteVarUInt32(uint value)
Writes the provided System.UInt32 to the output buffer as a variable-width integer.

Parameters

valueuint
The value.

WriteVarUInt64(ulong)

View source
public void WriteVarUInt64(ulong value)
Writes the provided System.UInt64 to the output buffer as a variable-width integer.

Parameters

valueulong
The value.