A data output stream class claims to write primitive Java data types to an output stream in a portable way.And it provides writeInt and other methods for their respective datatypes but if writeInt(65) and write(65) outputs the same data to file then what is the difference and use of writeInt
FileOutputStream file = new FileOutputStream("D:\\newfile.txt");
DataOutputStream data = new DataOutputStream(file);
data.write(65);
data.writeInt(65);
data.writeChar(65);
data.flush();
data.close();
I expect the output as A 65 A, but the actual output is A A A.
I know if we have to output integer as 65 we have to use write(65+"") but then what is the use of writeInt();