@Override
  public void writeInt(int i) throws IOException {
    StreamUtils.writeInt(this.os, i);
  }
Writes len bytes from the specified ByteBuffer starting at offset off to this OutputStream. If
off is negative or larger than the ByteBuffer then an ArrayIndexOutOfBoundsException is thrown.
If len is greater than the length of the ByteBuffer, then an ArrayIndexOutOfBoundsException is
thrown. This method does not change the position of the ByteBuffer.
@param b   the ByteBuffer
@param off the start offset in the data
@param len the number of bytes to write
@throws IOException          if an I/O error occurs. In particular, an IOException is thrown if
                             the output stream is closed.
@throws NullPointerException if {@code b} is {@code null}
hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBufferWriterOutputStream.java