bufr/src/main/java/ucar/nc2/iosp/bufr/MessageScanner.java
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());
  }
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.

@param raf check this file
@return true if its a BUFR file
@throws IOException on read error