code: public static int getBytesIntValue(byte[] bytes, int offset, int length) {
          assert length <= 4 && length > 0;
          assert bytes != null && bytes.length >= length + offset;
          byte[] value = Arrays.copyOfRange(bytes, offset, offset + length);
          return bytesToInt(value);
      }
docs: Retrieves the integer value of a subarray of bytes. The values are
  considered little endian. The subarray is determined by offset and
  length.
  <p>
  Presumes the bytes to be not null and the length must be between 1 and 4
  inclusive. The length of bytes must be larger than or equal to length +
  offset.
  
  @param bytes
  the little endian byte array that shall be converted to int
  @param offset
  the index to start reading the integer value from
  @param length
  the number of bytes used to convert to int
  @return int value