private static int parseInt ( Input s ) { if ( s . index >= s . len ) throw new DateFormatException ( "unexpected end of input" , s . str , s . index ) ; int result = 0 ; while ( s . index < s . len ) { char c = s . getChar ( ) ; if ( c >= ' ' && c <= ' ' ) { if ( result >= Integer . MAX_VALUE / 10 ) throw new ArithmeticException ( "Field too large." ) ; result = result * 10 + ( ( int ) c - ( int ) ' ' ) ; s . index ++ ; } else { break ; } } return result ; }
Parse an integer from the input reading up to the first non - numeric character .