How to read a .dat file in Java and write that data from that file into a text file? The 101.dat is a binary file.
DataOutputStream dos = new DataOutputStream(new FileOutputStream( "101.dat")); System.out.println("result " + dos.size());
for (int i = 0; i < 100; i++) {
dos.writeInt(i);
System.out.println(i);
}
dos.close();
The dos.size() method is giving me size 0. But the size should be something