readPacketLength static method
Returns the length field of the packet. This is the number of bytes
following the length field except for the MAC. packet can be partitial.
Implementation
static int readPacketLength(Uint8List packet) {
return ByteData.sublistView(packet).getUint32(0);
}