code: public int getInteger(int len) throws IOException {
  
          BigInteger result = getBigInteger(len, false);
          if (result.compareTo(BigInteger.valueOf(Integer.MIN_VALUE)) < 0) {
              throw new IOException("Integer below minimum valid value");
          }
          if (result.compareTo(BigInteger.valueOf(Integer.MAX_VALUE)) > 0) {
              throw new IOException("Integer exceeds maximum valid value");
          }
          return result.intValue();
      }
docs: Returns the integer which takes up the specified number
  of bytes in this buffer.
  @throws IOException if the result is not within the valid
  range for integer, i.e. between Integer.MIN_VALUE and
  Integer.MAX_VALUE.
  @param len the number of bytes to use.
  @return the integer.