code: private void writeBuffer() throws IOException {
      for (int pos = 0; pos < currentBufferSize; pos++) {
        if (isByte[pos]) {
          aFile.write((byte) buffer[pos]);
        } else {
          aFile.write(buffer[pos]);
        }
      }
    }
docs: Write buffer.
  
  @throws IOException Signals that an I/O exception has occurred.