Return 24-bit unsigned int from buffer. (big-endian)

@see mysql-5.6.10/include/myisampack.h - mi_usint3korr
169168
public final int getBeUint24(final int pos) {
        final int position = origin + pos;

        if (pos + 2 >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: "
                                                                            + (pos < 0 ? pos : (pos + 2)));

        byte[] buf = buffer;
        return (0xff & buf[position + 2]) | ((0xff & buf[position + 1]) << 8) | ((0xff & buf[position]) << 16);
    }
419
public int readRawLittleEndian32() throws IOException
    {
        final byte[] buffer = this.buffer;
        int offset = this.offset;

        final byte b1 = buffer[offset++];
        final byte b2 = buffer[offset++];
        final byte b3 = buffer[offset++];
        final byte b4 = buffer[offset++];

        this.offset = offset;

        return (((int) b1 & 0xff)) |
                (((int) b2 & 0xff) << 8) |
                (((int) b3 & 0xff) << 16) |
                (((int) b4 & 0xff) << 24);
    }
1138341
public static long readUnsignedIntegerBigEndian(ByteBuffer buf) {
		long value;
		value = ((long)(buf.get() & 0xFF)) << 24;
		value |= (buf.get() & 0xFF) << 16;
		value |= (buf.get() & 0xFF) << 8;
		value |= (buf.get() & 0xFF);
		return value;
	}
217984
static int getInt(final byte[] arr, final long off) throws IOException {
        final int ioff = (int) off;
        if (ioff < 0 || ioff > arr.length - 4) {
            throw new IndexOutOfBoundsException();
        }
        return ((arr[ioff + 3] & 0xff) << 24) //
                | ((arr[ioff + 2] & 0xff) << 16) //
                | ((arr[ioff + 1] & 0xff) << 8) //
                | (arr[ioff] & 0xff);
    }
788781
private static int extractInt(byte[] arr, int offset) {
        return ((arr[offset] & 0xFF) << 24) | ((arr[offset + 1] & 0xFF) << 16) | ((arr[offset + 2] & 0xFF) << 8)
                | (arr[offset + 3] & 0xFF);
    }
1144590
public long getLong() {
        return ((long) (_buffer[_offset++] & 0xff) << 56 | (long) (_buffer[_offset++] & 0xff) << 48
                | (long) (_buffer[_offset++] & 0xff) << 40 | (long) (_buffer[_offset++] & 0xff) << 32
                | (long) (_buffer[_offset++] & 0xff) << 24 | (long) (_buffer[_offset++] & 0xff) << 16
                | (long) (_buffer[_offset++] & 0xff) << 8 | (long) (_buffer[_offset++] & 0xff));
    }
987720
public final int getBeInt24(final int pos) {
        final int position = origin + pos;

        if (pos + 2 >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: "
                                                                            + (pos < 0 ? pos : (pos + 2)));

        byte[] buf = buffer;
        return (0xff & buf[position + 2]) | ((0xff & buf[position + 1]) << 8) | ((buf[position]) << 16);
    }
187931
public final int getInt32(final int pos) {
        final int position = origin + pos;

        if (pos + 3 >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: "
                                                                            + (pos < 0 ? pos : (pos + 3)));

        byte[] buf = buffer;
        return (0xff & buf[position]) | ((0xff & buf[position + 1]) << 8) | ((0xff & buf[position + 2]) << 16)
               | ((buf[position + 3]) << 24);
    }
646283
public final static int readReverseInt(IoBuffer in) {
        int value = in.getInt();
        value = ((value & 0xFF) << 24 | ((value >> 8) & 0x00FF) << 16 | ((value >>> 16) & 0x000000FF) << 8 | ((value >>> 24) & 0x000000FF));
        return value;
    }
1060591
private int grabNext16BitInt() throws WsocBufferException {
        int value = 0;
        byte b1;
        byte b2;

        // Network order data should be Big Endian, so first byte read is most significant.  Java is also Big Endian, so...
        b1 = this.grabNextByte();
        b2 = this.grabNextByte();
        // not sure one needs the "&" below - but put it in for safety given the typecasting
        value = ((b1) & 0x000000ff) << 8 | ((b2) & 0x000000ff);

        return value;
    }
99848
public static int readInt(byte[] bytes, int start) {
        return (((bytes[start] & 0xff) << 24) +
            ((bytes[start + 1] & 0xff) << 16) +
            ((bytes[start + 2] & 0xff) << 8) +
            ((bytes[start + 3] & 0xff)));

    }
1316721
static long getFiveBytesLong(byte[] buffer, int offset) {
        return (buffer[offset] & 0xffL) << 32 | (buffer[offset + 1] & 0xffL) << 24 | (buffer[offset + 2] & 0xffL) << 16
                | (buffer[offset + 3] & 0xffL) << 8 | (buffer[offset + 4] & 0xffL);
    }
940227
public int readInt()
    throws IOException
  {
    if (_readOffset + 4 < _readLength) {
      return (((_readBuffer[_readOffset++] & 0xff) << 24)
              + ((_readBuffer[_readOffset++] & 0xff) << 16)
              + ((_readBuffer[_readOffset++] & 0xff) << 8)
              + ((_readBuffer[_readOffset++] & 0xff)));
    }
    else {
      return ((read() << 24)
              + (read() << 16)
              + (read() << 8)
              + (read()));
    }
  }
1352937
private int readInteger() {
        int b = buf.get();
        if (buf.hasRemaining()) {
            int n = 0;
            int result = 0;
            while ((b & 0x80) != 0 && n < 3) {
                result <<= 7;
                result |= (b & 0x7f);
                b = buf.get();
                n++;
            }
            if (n < 3) {
                result <<= 7;
                result |= b;
            } else {
                // use all 8 bits from the 4th byte
                result <<= 8;
                result |= b & 0x0ff;
                // check if the integer should be negative
                if ((result & 0x10000000) != 0) {
                    // extend the sign bit
                    result |= 0xe0000000;
                }
            }
            return result;
        }
        return b;
    }
456846
public long readUnsignedIntAsLong(int off) {
    	buffer.position(off);
        return (((long)(buffer.get() & 0xff) << 24) |
                ((long)(buffer.get() & 0xff) << 16) |
                ((long)(buffer.get() & 0xff) << 8) |
                ((long)(buffer.get() & 0xff))) & 0xFFFFFFFFL;
    }
224997
final public function readInt24BE()
    {
        if ($this->isLittleEndian()) {
            return $this->fromInt24(strrev($this->read(3)));
        } else {
            return $this->fromInt24($this->read(3));
        }
    }
1044331
public static int bytesToInt(byte[] b)
    {
        int i = (b[0] << 24) & 0xFF000000;
        i |= (b[1] << 16) & 0xFF0000;
        i |= (b[2] << 8) & 0xFF00;
        i |= b[3] & 0xFF;
        return i;
    }