io - reading java class files using java program -


i writing java code me read , print byte code in .class file.

i have tried surfing internet, answers dont answer question.
below code have based on found on stackoverflow

private static void readbyte ( ) {      path file = paths.get("bin/com/reading/frombyte/readfourbytes.class");                try {          byte[] mybytes = files.readallbytes(file);          for(byte b : mybytes)              system.out.println((char)b);      } catch (ioexception e) {          e.printstacktrace();      } } 

basically want interpret these bytes human-readable characters.

thanks in advance

i think command you:

javap -verbose -c -private readfourbytes 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -