public FileFormat determineFileFormat ( File bibfile ) throws FileNotFoundException , IOException { if ( ! bibfile . exists ( ) ) { throw new FileNotFoundException ( "Bibliography file `" + bibfile . getName ( ) + "' does not exist" ) ; } try ( BufferedInputStream bis = new BufferedInputStream ( new FileInputStream ( bibfile ) ) ) { return determineFileFormat ( bis , bibfile . getName ( ) ) ; } }
Reads the first 100 KB of the given bibliography file and tries to determine the file format