Share via


HeaderSerializer Class

Definition

The 48-byte, fixed size, header prefaces every payload. The header must always have the same shape, regardless of if its payload is a request, response, or content. It is a period-delimited ASCII-encoded string terminated with a newline. All headers must have these segments, and all values must be zero padded to fill the correct number of bytes: |Title Size Description |Type 1 byte ASCII-encoded char. Describes the format of the payload (request, response, stream, etc.) |Delimiter 1 byte ASCII period character |Length 6 bytes ASCII-encoded decimal. Size in bytes of this payload in ASCII decimal, not including the header. Zero padded. |Delimiter 1 byte ASCII period character |ID 36 bytes ASCII-encoded hex. GUID (Request ID, Stream ID, etc.) |Delimiter 1 byte ASCII period character |End 1 byte ASCII ‘0’ or ‘1’. Signals the end of a payload or multi-part payload |Terminator 1 byte Hardcoded to \n ex: A.000168.68e999ca-a651-40f4-ad8f-3aaf781862b4.1\n end example.

public static class HeaderSerializer
type HeaderSerializer = class
Public Class HeaderSerializer
Inheritance
HeaderSerializer

Fields

Delimiter

ASCII period character.

End

ASCII ‘1’. Signals the end of a payload or multi-part payload.

EndOffset

The offset from the first character in the header to the End section.

IdDelimeterOffset

The offset from the first character in the header to the ID delimiter.

IdLength

The length in bytes of the ID section.

IdOffset

The offset from the first character in the header to the Id section.

LengthDelimeterOffset

The offset from the first character in the header to the Length delimiter.

LengthLength

The length in bytes of the Length value.

LengthOffset

The offset from the first character in the header to the Length section.

NotEnd

ASCII ‘0’. Signals this is not the end of a payload or multi-part payload.

Terminator

Hardcoded to \n .

TerminatorOffset

The offset from the first character in the header to the Terminator section.

TypeDelimiterOffset

The offset from the first character in the header to the Type delimiter.

TypeOffset

The offset from the first character in the header to the Type section.

Methods

Deserialize(Byte[], Int32, Int32)

Deserialize the passed in byte array into the returned Header.

Serialize(Header, Byte[], Int32)

Serializes the passed in header into the passed in byte array.

Applies to