public ByteBuffer getByteBuffer() {
    curBuf.flip();
    return curBuf;
  }
This flips the underlying BB so be sure to use it _last_!
hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBufferOutputStream.java