static public boolean isValidFile ( ucar . unidata . io . RandomAccessFile raf ) throws IOException { raf . seek ( 0 ) ; if ( ! raf . searchForward ( matcher , 40 * 1000 ) ) return false ; // must find "BUFR" in first 40k raf . skipBytes ( 4 ) ; BufrIndicatorSection is = new BufrIndicatorSection ( raf ) ; if ( is . getBufrEdition ( ) > 4 ) return false ; // if(is.getBufrLength() > MAX_MESSAGE_SIZE) return false; return ! ( is . getBufrLength ( ) > raf . length ( ) ) ; }
is this a valid BUFR file .