@Override
  public void write(ByteBuffer b, int off, int len) throws IOException {
    ByteBufferUtils.copyBufferToStream(out, b, off, len);
    written += len;
  }
Our extension of DataOutputStream which implements ByteBufferWriter
hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBufferWriterDataOutputStream.java