dcsimg

How can I determine if a file is a Java class file?

John Zukowski

If the first four bytes of a file are not 0xCAFEBABE then you do not have a Java class file. This testing is done as part of the first pass of the Java verifier.