• Post Reply Bookmark Topic Watch Topic
  • New Topic

Opening .exe file in Java  RSS feed

 
Ganesh Prakhya
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I need to open an .exe file using Java. I don't want to run that exe with Java, but I need to open the .exe using Java (to see the binary). I am able to open .exe in EditPlus tool, the same content I want to see in Java console when I run the Java programme.

Please suggest me a way to do that.

NOTE: We should not use readLine() method, as I tried with that, it is not giving right binary content and also causing continuous beep.

Thanks in advance,
Ganesh.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't use BufferedReader - it's for text streams, not binary data, as you found out. Use BufferedInputStream instead to read into a byte array.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to "I/O and Streams."
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!