encodeAsBinary static method

dynamic encodeAsBinary(
  1. dynamic obj,
  2. dynamic callback
)

Implementation

static encodeAsBinary(obj, callback) {
  writeEncoding(bloblessData) {
    var deconstruction = Binary.deconstructPacket(bloblessData);
    var pack = encodeAsString(deconstruction['packet']);
    var buffers = deconstruction['buffers'];

    callback(<dynamic>[pack, ...buffers]); // write all the buffers
  }

  writeEncoding(obj);
}