10 lines
248 B
Java
10 lines
248 B
Java
package org.jcodec.common;
|
|
|
|
public class Ints {
|
|
public static int checkedCast(long value) {
|
|
int result = (int)value;
|
|
if ((long)result != value)
|
|
throw new IllegalArgumentException("Out of range: " + value);
|
|
return result;
|
|
}
|
|
}
|