How to read content of .EXE file in Java
问题 What are the possible options and the most appropiate for reading an executable file in Java. I want produce the hexadecimal representation of an .exe file. Im thinking of reading the file in binary and then doing the conversion. But how can i read the .exe? 回答1: 1) read the file in as bytes. use BufferedInputStream( new FileInputStream( new File("bin.exe") ) ) 2) convert each byte to hex format. static final String HEXES = "0123456789ABCDEF"; public static String getHex( byte [] raw ) { if (