• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Opening .exe file in Java

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43045
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author and iconoclast
Posts: 24204
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to "I/O and Streams."
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic