@Override
      int putInt(ByteBuffer buffer, int index, int val) {
        buffer.putInt(index, val);
        return index + Bytes.SIZEOF_INT;
      }
Utility functions for working with byte buffers, such as reading/writing variable-length long
numbers.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferUtils.java