write = (encoder, num) => {
  const bufferLen = encoder.cbuf.length;

  if (encoder.cpos === bufferLen) {
    encoder.bufs.push(encoder.cbuf);
    encoder.cbuf = new Uint8Array(bufferLen * 2);
    encoder.cpos = 0;
  }

  encoder.cbuf[encoder.cpos++] = num;
}
Write one byte to the encoder.

@function
@param {Encoder} encoder
@param {number} num The byte that is to be encoded.