set = (encoder, pos, num) => {
  let buffer = null; // iterate all buffers and adjust position

  for (let i = 0; i < encoder.bufs.length && buffer === null; i++) {
    const b = encoder.bufs[i];

    if (pos < b.length) {
      buffer = b; // found buffer
    } else {
      pos -= b.length;
    }
  }

  if (buffer === null) {
    // use current buffer
    buffer = encoder.cbuf;
  }

  buffer[pos] = num;
}
Write one byte at a specific position.
Position must already be written (i.e. encoder.length > pos)

@function
@param {Encoder} encoder
@param {number} pos Position to which to write data
@param {number} num Unsigned 8-bit integer