public static int putByte(ByteBuffer buf, int offset, byte b) {
    if (buf.isDirect()) {
      HBasePlatformDependent.putByte(directBufferAddress(buf) + offset, b);
    } else {
      HBasePlatformDependent.putByte(buf.array(),
        BYTE_ARRAY_BASE_OFFSET + buf.arrayOffset() + offset, b);
    }
    return offset + 1;
  }
Put a byte value out to the specified BB position in big-endian format.
@param buf    the byte buffer
@param offset position in the buffer
@param b      byte to write out
@return incremented offset
hbase-common/src/main/java/org/apache/hadoop/hbase/util/UnsafeAccess.java