Can someone explain the difference between filestream's
writeUTF and writeUTFBytes methods?
I just realized that files saved with writeUTF have weird
characters saved in front of them. I think this is because writeUTF
tries to save the length of the string as an integer in front of
the file (though the actual character saved never appears to be an
integer when I open it). Why would it do this? What file type would
have an integer length at the beginning of it? The language
reference doesn't really explain this in any detail.
Also, when saving files with writeUTF, I sometimes get Error
#2006: The supplied index is out of bounds. I do not get this error
saving the same file with writeUTFBytes. To my knowledge I am not
supplying any index to anything, i am just writing a string to a
filestream, so I don't understand what could possibly be out of
bounds. Does this have something to do with the length integer?