docs: public void write(byte[] buffer, int offset, int count) throws IOException {
      if (offset < 0 || count < 0 || offset + count > buffer.length) {
        throw new ArrayIndexOutOfBoundsException("length=" + buffer.length + "; regionStart=" + offset
            + "; regionLength=" + count);
      }
      ensureValid();
      realloc(mCount + count);
      mBufRef.get().write(mCount, buffer, offset, count);
      mCount += count;
    }