getPayloadLength static method
Implementation
@pragma('vm:prefer-inline')
static int getPayloadLength(Uint8List buffer, [int offset = 0]) {
if (offset < 0 || offset > buffer.length - 3) {
throw MySQLProtocolException(
'Truncated MySQL packet header: cannot read payload length at offset '
'$offset (buffer length ${buffer.length})',
);
}
return buffer[offset] |
(buffer[offset + 1] << 8) |
(buffer[offset + 2] << 16);
}