I am using a FileOutputStream to write binary (byte array) data to a file.
Right upon instanciation of the stream:
I get 0xFFFE added to the front of the file. (before I even try to write to the stream).
Then when I do write using something like this:
I get the data in my file, but if I view it in a hex editor, I see an extra 0x00 after each byte. This causes my file to be twice as large as it should and the binary data obviously isn't correct.
Any clues?
Right upon instanciation of the stream:
Code:
FileOutputStream fos = new FileOutputStream(new File("c:\\temp\\file.bin"))
Then when I do write using something like this:
Code:
byte[] b = "Hello there!".toBytes();
fos.write(b);
I get the data in my file, but if I view it in a hex editor, I see an extra 0x00 after each byte. This causes my file to be twice as large as it should and the binary data obviously isn't correct.
Any clues?