HeaderSerializer class
Streaming header serializer
Properties
Delimiter | |
Encoding | |
End | |
End |
|
Id |
|
Id |
|
Id |
|
Length |
|
Length |
|
Length |
|
Not |
|
Terminator | |
Terminator |
|
Type |
|
Type |
Methods
deserialize(INode |
Deserializes a buffer containing header information. |
header |
Creates a padded string based on a length and character to be padded to. |
serialize(IHeader, INode |
Serializes the header into a buffer |
Property Details
Delimiter
static Delimiter: "." = "."
Property Value
"."
Encoding
static Encoding: "utf8" = "utf8"
Property Value
"utf8"
End
static End: "1" = "1"
Property Value
"1"
EndOffset
static EndOffset: 46 = 46
Property Value
46
IdDelimeterOffset
static IdDelimeterOffset: 45 = 45
Property Value
45
IdLength
static IdLength: 36 = 36
Property Value
36
IdOffset
static IdOffset: 9 = 9
Property Value
9
LengthDelimeterOffset
static LengthDelimeterOffset: 8 = 8
Property Value
8
LengthLength
static LengthLength: 6 = 6
Property Value
6
LengthOffset
static LengthOffset: 2 = 2
Property Value
2
NotEnd
static NotEnd: "0" = "0"
Property Value
"0"
Terminator
static Terminator: "
" = "
"
Property Value
" "
TerminatorOffset
static TerminatorOffset: 47 = 47
Property Value
47
TypeDelimiterOffset
static TypeDelimiterOffset: 1 = 1
Property Value
1
TypeOffset
static TypeOffset: number
Property Value
number
Method Details
deserialize(INodeBuffer)
Deserializes a buffer containing header information.
static function deserialize(buffer: INodeBuffer): IHeader
Parameters
- buffer
- INodeBuffer
The buffer from which to obtain the data to deserialize.
Returns
The deserialized header from the buffer.
headerLengthPadder(number, number, string)
Creates a padded string based on a length and character to be padded to.
static function headerLengthPadder(lengthValue: number, totalLength: number, padChar: string): string
Parameters
- lengthValue
-
number
The value to be assingned on the result.
- totalLength
-
number
The length of the padded string result.
- padChar
-
string
The character value to use as filling.
Returns
string
The padded string.
serialize(IHeader, INodeBuffer)
Serializes the header into a buffer
static function serialize(header: IHeader, buffer: INodeBuffer)
Parameters
- header
- IHeader
The header to serialize.
- buffer
- INodeBuffer
The buffer into which to serialize the header.