@Override
      int putShort(ByteBuffer buffer, int index, short val) {
        buffer.putShort(index, val);
        return index + Bytes.SIZEOF_SHORT;
      }
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