@Override
      int toInt(ByteBuffer buffer) {
        int i = UnsafeAccess.toInt(buffer, buffer.position());
        buffer.position(buffer.position() + Bytes.SIZEOF_INT);
        return i;
      }
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