• Post Reply Bookmark Topic Watch Topic
  • New Topic

Read a C file in Java  RSS feed

 
Murat YILDIZ
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I need to read within Java code a binary file which was written using 'fwrite' method in 'C'.
The C file result is:
"~' �4 o "
and the translate:
"0000000 10110 00000 13440 00000 00367 00000 00010
0000015"
Thanks to anyone who could help.
 
Greg Charles
Sheriff
Posts: 3014
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you can use a file input stream to read the file into an array of bytes. After that, I'm not sure what it is you want to do. Are you trying to display it? Is that octal? You can do something like:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!