MessageHeader constructor
MessageHeader(
- Uint8List data
constructor from Uint8List(receive data).
Implementation
MessageHeader(Uint8List data) {
String? header = parseHeaderSize(utf8.decode(data));
if (header == null) {
rawData = "";
return;
} else {
rawData = header;
}
command = parseHeaderSection(header, Sections.command.name) ?? "";
bodySize =
int.parse(parseHeaderSection(header, Sections.bodySize.name) ?? "0");
}