Here is my code:
File file = new File("test.txt");
file.createNewFile();
OutputStream outputStream = new FileOutputStream(file);
outputStream.write(65);
outputStream.write(66);
outputStream.flush();
outputStream.close();
When I open test.txt in a Text editor I will see
AB
which are the UTF-8 characters with values 65 and 66.
I take a hex dump of the file and I see:
File Owner: koraytugay
Group Owner: staff
File Size: 2 Bytes
File Creation Date: 2014-11-04 13:18:45 +0000
File Modification Date: 2014-11-04 13:19:01 +0000
HEX DUMP:
[] 41 42 AB
So what is [] 41 42 supposed to mean here? Why not 65 and 66?