private void writeData(OutputStream sink) throws IOException {
    try (OutputStream out = sink) {
      out.write(myBuffer.getInternalBuffer(), 0, myBuffer.size());
    }
  }
private void writeData(OutputStream sink)