Converts four bytes of a byte array to a signed int.
<p/>
The byte order is big-endian.

@param buffer the byte array.
@param offset the offset in the array.
@return the int value.
764189
static int getInt(byte[] buffer, int offset) {
        return buffer[offset] << 24 | (buffer[offset + 1] & 0xff) << 16 | (buffer[offset + 2] & 0xff) << 8
                | (buffer[offset + 3] & 0xff);
    }
722617
public static void writeInt64(final long value, final byte[] buffer, int offset)
    {
        buffer[offset++] = (byte) (value >>> 56);
        buffer[offset++] = (byte) (value >>> 48);
        buffer[offset++] = (byte) (value >>> 40);
        buffer[offset++] = (byte) (value >>> 32);
        buffer[offset++] = (byte) (value >>> 24);
        buffer[offset++] = (byte) (value >>> 16);
        buffer[offset++] = (byte) (value >>> 8);
        buffer[offset] = (byte) (value >>> 0);
    }
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);
    }
451057
public static void writeInt(byte[] b, int offset, int value) {
    b[offset++] = (byte) (value >>> 24);
    b[offset++] = (byte) (value >>> 16);
    b[offset++] = (byte) (value >>> 8);
    b[offset] = (byte)value;
  }
821871
@Override
  public byte []nextBuffer(int offset)
    throws IOException
  {
    if (offset < 0 || SIZE < offset) {
      throw new IllegalStateException(L.l("Invalid offset: " + offset));
    }
    
    if (_bufferCapacity <= SIZE
        || _bufferCapacity <= offset + _bufferSize) {
      _offset = offset;
      flushByteBuffer();

      return buffer();
    }
    else {
      _tBuf.length(offset);
      _bufferSize += offset;

      TempBuffer tempBuf = TempBuffer.create();
      _tBuf.next(tempBuf);
      _tBuf = tempBuf;

      _buffer = _tBuf.buffer();
      _offset = _startOffset;

      return _buffer;
    }
  }
925051
@SuppressWarnings("deprecation")
    private static int unsignedShortBE(ByteBuf buffer, int offset) {
        return buffer.order() == ByteOrder.BIG_ENDIAN ?
                buffer.getUnsignedShort(offset) : buffer.getUnsignedShortLE(offset);
    }
1041552
public static int readUnsignedInt(byte[] bytes, int offset) {
      byte b = bytes[offset++];
      int i = b & 0x7F;
      for (int shift = 7; (b & 0x80) != 0; shift += 7) {
         b = bytes[offset++];
         i |= (b & 0x7FL) << shift;
      }
      return i;
   }
346525
public static long readUnsignedInt(byte[] bytes, int offset) {
        return (((bytes[offset + 0] & 0xffL) << 24) | ((bytes[offset + 1] & 0xffL) << 16)
                | ((bytes[offset + 2] & 0xffL) << 8) | (bytes[offset + 3] & 0xffL));
    }
992996
public int readInt () throws KryoException {
		require(4);
		byte[] buffer = this.buffer;
		int p = this.position;
		this.position = p + 4;
		return buffer[p] & 0xFF //
			| (buffer[p + 1] & 0xFF) << 8 //
			| (buffer[p + 2] & 0xFF) << 16 //
			| (buffer[p + 3] & 0xFF) << 24;
	}
59451
public static byte[] bufferToArray(ByteBuffer buffer) {
    if (buffer.hasArray() && buffer.arrayOffset() == 0 &&
        buffer.array().length == buffer.remaining()) {
      return buffer.array();
    } else {
      byte[] bytes = new byte[buffer.remaining()];
      buffer.get(bytes);
      return bytes;
    }
  }
754340
public static IntArray getInstance(byte[] buffer, int offset, int length)
    {
        return getInstance(buffer, offset, length, 8, ByteOrder.BIG_ENDIAN);
    }
1144417
public static int readIntegerBigEndian(byte[] buffer, int offset) {
		int value;
		value = (buffer[offset] & 0xFF) << 24;
		value |= (buffer[offset + 1] & 0xFF) << 16;
		value |= (buffer[offset + 2] & 0xFF) << 8;
		value |= (buffer[offset + 3] & 0xFF);
		return value;
	}
540975
@Override
	public int read(byte[] buffer, int offset, int len) throws IOException {
		return this.in.read(buffer, offset, len);
	}
78521
public int getInt(int offset)
  {
    byte []code = getCode();
    
    int b0 = code[offset + 0] & 0xff;
    int b1 = code[offset + 1] & 0xff;
    int b2 = code[offset + 2] & 0xff;
    int b3 = code[offset + 3] & 0xff;
    
    return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3;
  }
511274
public static final int getInt(byte[] data, int offset)
   {
      int result = 0;
      int i = offset;
      for (int shiftBy = 0; shiftBy < 32; shiftBy += 8)
      {
         result |= ((data[i] & 0xff)) << shiftBy;
         ++i;
      }
      return result;
   }
889959
public static int readInt(byte[] buf, int pos) {
    checkBoundary(buf, pos, 4);
    return (((buf[pos++] & 0xff) << 24) | ((buf[pos++] & 0xff) << 16)
        | ((buf[pos++] & 0xff) << 8) | (buf[pos] & 0xff));
  }
80622
private static function getIntegerFromBuffer($buffer, &$offset, $delimiter = 'e')
    {
        $numeric = '';
        $offsetMarker = $offset;

        while (($byte = $buffer[$offset++]) !== $delimiter) {
            $numeric .= $byte;
        }

        $integer = (int) $numeric;
        if ($numeric != $integer) {
            throw new DecodingException("Invalid integer: $numeric", $offsetMarker);
        }

        return $integer;
    }