public static byte toByte(ByteBuffer buffer, int offset) {
    if (UNSAFE_AVAIL) {
      return UnsafeAccess.toByte(buffer, offset);
    } else {
      return buffer.get(offset);
    }
  }
Put in output stream 32 bit integer (Big Endian byte order).
@param out   Where to put integer.
@param value Value of integer.
@throws IOException On stream error.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferUtils.java