private static boolean matchNaN ( byte [ ] str , byte firstchar , int start , int end ) { final int len = end - start ; if ( len < 2 || len > 3 || ( firstchar != ' ' && firstchar != ' ' ) ) { return false ; } final byte c1 = str [ start + 1 ] ; if ( c1 != ' ' && c1 != ' ' ) { return false ; } // Accept just "NA", too: if ( len == 2 ) { return true ; } final byte c2 = str [ start + 2 ] ; return c2 == ' ' || c2 == ' ' ; }
Match NaN in a number of different capitalizations .