<<< DataInputStream example: reading binary file | Index | DataOutputStream example: two ways to write a binary string >>> |
There are two ways to read/write binary strings, which results in data stored in two different formats:
writeUTF() writes memory block that takes up two bytes for each character
writeChars() stores strings in Universal Text format (UTF):
first two bytes contain the length of the String
followed by each character stored in a single byte
<<< DataInputStream example: reading binary file | Index | DataOutputStream example: two ways to write a binary string >>> |