writeBinary method
Writes a Uint8List into the buffer
buffer
: the value to write
Implementation
@override
void writeBinary(Uint8List buffer) {
final length = buffer.length;
if (length <= 0xFF) {
writeUint8(types.bin8);
writeUint8(length);
} else if (length <= 0xFFFF) {
writeUint8(types.bin16);
writeUint16(length);
} else if (length <= 0xFFFFFFFF) {
writeUint8(types.bin32);
writeUint32(length);
} else {
throw MsgPackOverflowError(
'Data is too long to be serialized with msgpack.');
}
writeBytes(buffer);
}