Get a <i>int</i> from the given byte array starting at the given offset
in big endian order.
There is no bounds checking.
@param array source byte array
@param offset source offset
@return the <i>int</i>
164126
public static int getIntBE(final byte[] array, final int offset) {
    return  ( array[offset + 3] & 0XFF       )
          | ((array[offset + 2] & 0XFF) <<  8)
          | ((array[offset + 1] & 0XFF) << 16)
          | ((array[offset    ] & 0XFF) << 24);
  }
1057972
public static int readInt(byte[] array, int offset) {
    // First make integers to resolve signed vs. unsigned issues.
    int b0 = array[offset + 0] & 0xFF;
    int b1 = array[offset + 1] & 0xFF;
    int b2 = array[offset + 2] & 0xFF;
    int b3 = array[offset + 3] & 0xFF;
    return ((b0 << 24) + (b1 << 16) + (b2 << 8) + (b3 << 0));
  }
1333603
public static long readLong(byte[] array, int offset) {
    // First make integers to resolve signed vs. unsigned issues.
    long b0 = array[offset + 0];
    long b1 = array[offset + 1] & 0xFF;
    long b2 = array[offset + 2] & 0xFF;
    long b3 = array[offset + 3] & 0xFF;
    long b4 = array[offset + 4] & 0xFF;
    int b5 = array[offset + 5] & 0xFF;
    int b6 = array[offset + 6] & 0xFF;
    int b7 = array[offset + 7] & 0xFF;
    return ((b0 << 56) + (b1 << 48) + (b2 << 40) + (b3 << 32) + (b4 << 24) + (b5 << 16) + (b6 << 8) + (b7 << 0));
  }
409457
public static int unpackInt(final byte[] array, final JBBPIntCounter position) {
    final int code = array[position.getAndIncrement()] & 0xFF;
    if (code < 0x80) {
      return code;
    }

    final int result;
    switch (code) {
      case 0x80: {
        result = ((array[position.getAndIncrement()] & 0xFF) << 8) | (array[position.getAndIncrement()] & 0xFF);
      }
      break;
      case 0x81: {
        result = ((array[position.getAndIncrement()] & 0xFF) << 24)
            | ((array[position.getAndIncrement()] & 0xFF) << 16)
            | ((array[position.getAndIncrement()] & 0xFF) << 8)
            | (array[position.getAndIncrement()] & 0xFF);
      }
      break;
      default:
        throw new IllegalArgumentException("Unsupported packed integer prefix [0x" + Integer.toHexString(code).toUpperCase(Locale.ENGLISH) + ']');
    }
    return result;
  }
1223830
private static void writeInt(int value, byte[] array, int offset) {
    for (int i = 0; i < 4; i++) {
      array[offset + i] = (byte) (value >>> (8 * i));
    }
  }
747606
public static final void writeInt(int value, byte[] array, int offset)
    {
        if (array.length < offset + 4)
        {
            throw new IllegalArgumentException("no room in array");
        }
        array[offset] = (byte) (value >> 24);
        array[offset + 1] = (byte) ((value >> 16) & 0xff);
        array[offset + 2] = (byte) ((value >> 8) & 0xff);
        array[offset + 3] = (byte) (value & 0xff);
    }
387760
private static int get16(byte[] b, int off) {
        return Byte.toUnsignedInt(b[off]) | ( Byte.toUnsignedInt(b[off+1]) << 8);
    }
754340
public static IntArray getInstance(byte[] buffer, int offset, int length)
    {
        return getInstance(buffer, offset, length, 8, ByteOrder.BIG_ENDIAN);
    }
1112314
@Override public long indexOf(byte b, long fromIndex) {
    if (fromIndex < 0) throw new IllegalArgumentException("fromIndex < 0");

    Segment s = head;
    if (s == null) return -1L;
    long offset = 0L;
    do {
      int segmentByteCount = s.limit - s.pos;
      if (fromIndex >= segmentByteCount) {
        fromIndex -= segmentByteCount;
      } else {
        byte[] data = s.data;
        for (int pos = (int) (s.pos + fromIndex), limit = s.limit; pos < limit; pos++) {
          if (data[pos] == b) return offset + pos - s.pos;
        }
        fromIndex = 0;
      }
      offset += segmentByteCount;
      s = s.next;
    } while (s != head);
    return -1L;
  }
937711
public static final int readInt(byte[] array, int offset)
    {
        if (array.length < offset + 4)
        {
            throw new IllegalArgumentException("no room in array");
        }
        return
                ((array[offset]<<24) & 0xff000000) +
                ((array[offset + 1]<<16) & 0xff0000)  +
                ((array[offset + 2]<<8) & 0xff00)  +
                (array[offset + 3] & 0xff );
    }
298716
public static long max( long []array , int offset , int length ) {
		long max = -Long.MAX_VALUE;
		for (int i = 0; i < length; i++) {
			long tmp = array[offset+i];
			if( tmp > max ) {
				max = tmp;
			}
		}
		return max;
	}
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);
    }
378435
public static byte[] writeInt(int v, byte[] b, int offset) {
        b[offset] = (byte) v;
        b[offset + 1] = (byte) (v >> 8);
        b[offset + 2] = (byte) (v >> 16);
        b[offset + 3] = (byte) (v >> 24);

        return b;
    }
847086
@Override
    public int getInt(final int index) {
        boundsCheck(index, Bits.INT_SIZE_IN_BYTES);

        int bits = MEM.getInt(byteArray, addressOffset + index);
        if (NATIVE_BYTE_ORDER != PROTOCOL_BYTE_ORDER) {
            bits = Integer.reverseBytes(bits);
        }

        return bits;
    }
545971
public static int getInt(MemorySegment[] segments, int offset) {
		if (inFirstSegment(segments, offset, 4)) {
			return segments[0].getInt(offset);
		} else {
			return getIntMultiSegments(segments, offset);
		}
	}
1277947
static int getSignedInt(ByteBuf buf, int offset) {
        return (buf.getByte(offset)     & 0xFF) << 24 |
               (buf.getByte(offset + 1) & 0xFF) << 16 |
               (buf.getByte(offset + 2) & 0xFF) <<  8 |
                buf.getByte(offset + 3) & 0xFF;
    }
960946
public byte[] getByteArray(Integer offset)
   {
      byte[] result = null;

      if (offset != null)
      {
         result = m_map.get(offset);
      }

      return (result);
   }