@Override
  public void write(int b) throws IOException {
    checkSizeAndGrow(Bytes.SIZEOF_BYTE);
    curBuf.put((byte) b);
  }
This flips the underlying BB so be sure to use it _last_!
hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBufferOutputStream.java