2 Topics

Member Avatar for
Member Avatar for daudiam

Both DataOutputStream and PrintStream do basically the same thing - convert primitive types and Strings to bytes before writing them (writeUTF() is an exception). Why different classes ?

Member Avatar for JamesCherrill
0
1K
Member Avatar for daudiam

gedit uses UTF encoding. Therefore, if we store binary data in the file (like through DataOutputStream's writeInt() or writeByte(), etc.), gedit would rightly complain, but if we write something through the writeUTF() function, then gedit should be able to open it as the data is written is UTF which it …

Member Avatar for daudiam
0
134

The End.