I\'m debugging some issues with writing pieces of an object to a file and I\'ve gotten down to the base case of just opening the file and writing \"TEST\" in it. I\'m doing
Remember that Java strings are internally encoded in UTF-16.
So, "test" is actually made of the bytes 0xff, 0xfe (together the byte order mark), 0x74, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x00.
You probably want to work with bytes instead of streams of characters.