0

How to read integer/double data type from a .dat file ? I used a Java program to creat a binary file and wrote an int data into it and now I am trying to open the file using Notepad/MS Word it's showing the character equivalent as ASCII value of the int number Please Help. Eg. int I = 77 When I opened .dat file in notepad/MS Word it showed- C

  • Well, what you describe reads like you've written _binary_ data to a file but expect a _text_ editor to display the correct value. That won't work. What do you want the file to contain: the characters `77` or the binary representation of the integer which might be hex code `00 00 00 4D` (or similar, depending on byte order etc.)? – Thomas Aug 25 '20 at 11:41
  • Can you show what code you used to create the file in the first place? – Joni Aug 25 '20 at 11:41
  • Thanx everyone. – Meta Tyrant Sep 08 '20 at 05:00

0 Answers0