public static int ensureOutputParameterInRange ( String name , long size ) { if ( size > Integer . MAX_VALUE ) { LOG . warn ( "cos: {} capped to ~2.14GB" + " (maximum allowed size with current output mechanism)" , name ) ; return Integer . MAX_VALUE ; } else { return ( int ) size ; } }
Ensure that the long value is in the range of an integer .