parquet-common/src/main/java/org/apache/parquet/Ints.java
public static int checkedCast(long value) {
    int valueI = (int) value;
    if (valueI != value) {
      throw new IllegalArgumentException(String.format("Overflow casting %d to an int", value));
    }
    return valueI;
  }
public static int checkedCast(long value) {
    int valueI = (int) value;
    if (valueI != value) {
      throw new IllegalArgumentException(String.format("Overflow casting %d to an int", value));
    }
    return valueI;
  }
public static int checkedCast ( long value ) { int valueI = ( int ) value ; if ( valueI != value ) { throw new IllegalArgumentException ( String . format ( "Overflow casting %d to an int" , value ) ) ; } return valueI ; }
Cast value to a an int, or throw an exception
if there is an overflow.

@param value a long to be casted to an int
@return an int that is == to value
@throws IllegalArgumentException if value can't be casted to an int
@deprecated replaced by {@link java.lang.Math#toIntExact(long)}
Cast value to a an int or throw an exception if there is an overflow .