public EngineType readEngineType ( ) throws IOException { try { engineType = EngineId . typeForMagic ( new String ( readBytes ( 8 ) ) ) ; if ( engineType == null ) { throw new IOException ( ) ; } return engineType ; } catch ( IOException e ) { throw new IOException ( "given stream does not seem to contain a valid replay" ) ; } }
reads the magic of a demo file identifying the engine type