MessageHeader class

a header class in message

format

<headerSize>\n[<sectionName>=<sectionData>\n...]

headerSize: the size exclude the header size string itself and a char of LF after that strings of the header.

sectionName: a name that describes represent the meaning of data written after the section name itself.

sectionData: data of a section.

example

this message header has a command section and a body size section. it represent SEND command and has 1000byte body data. (Body data is omitted)

"28\nCOMMAND=SEND\nBODY_SIZE=1000\n..."

Constructors

MessageHeader(Uint8List data)
constructor from Uint8List(receive data).
MessageHeader.fromParam({required String command, required int bodySize})
constructor from params(send data).

Properties

bodySize int
latefinal
command String
latefinal
hashCode int
The hash code for this object.
no setterinherited
headContent String
a content of the header exclude the header size section.
no setter
headerSize int
a header size exclude the header size section.
latefinal
message String
a content of the header all.
no setter
rawData String
raw data of the header exclude the header size section.
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseHeaderSection(String header, String section) String?
parse a section from all of header.
parseHeaderSize(String message) String?
parse header size of the received message.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

delimiter → const String
a delimiter string in a header.