encode method

Uint8List encode()

Implementation

Uint8List encode() {
  var opcodes = Uint8List(0);

  void _encode(int size) {
    opcodes.add(size & 0x7f);
    size = _zeroFillRightShift(size, 7);

    while (size > 0) {
      opcodes[opcodes.length - 1] |= 0x80;
      opcodes.add(size & 0x7f);
      size = size >> 7;
    }
  }

  _encode(baseBufferSize);
  _encode(targetBufferSize);

  return opcodes;
}