@Override
  public void write(ByteBuffer b, int off, int len) throws IOException {
    checkSizeAndGrow(len);
    ByteBufferUtils.copyFromBufferToBuffer(b, curBuf, off, len);
  }
Writes the complete contents of this byte buffer output stream to the specified output stream
argument.
@param out the output stream to which to write the data.
@exception IOException if an I/O error occurs.
hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBufferOutputStream.java