public static int putByte(ByteBuffer buffer, int offset, byte b) {
    if (UNSAFE_AVAIL) {
      return UnsafeAccess.putByte(buffer, offset, b);
    } else {
      buffer.put(offset, b);
      return offset + 1;
    }
  }
Copy data from a buffer to an output stream. Does not update the position in the buffer.
@param out    the output stream to write bytes to
@param in     the buffer to read bytes from
@param offset the offset in the buffer (from the buffer's array offset) to start copying bytes
              from
@param length the number of bytes to copy
hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferUtils.java