posted 14 years ago
Stephan, looks like you are partially correct or may be I am missing something here. So to validate your point I placed a print statement in the while loop to figure out how many times the loop was executed, to my surprise found some interesting behavior below -
with ByteStream -
1. Placed only 3 characters (ABC) in the input file and saved the txt with encoding UTF-8, output to console was 239, 187, 191, 65, 66, 67 (was expecting your answer 0, 65, 0, 66, 0, 67)
2. Saved the same input txt file as above with encoding - unicode, output was 255, 254, 65, 0, 66, 0, 67, 0
3. with encoding Unicode Big Endian, output was 254, 255, 0, 65, 0, 66, 0, 67
4. with Ansi encoding, output was 65, 66, 67
with CharacterStream -
1. UTF-8, output was 239, 187, 191, 65, 66, 67
2. Unicode, output was 255, 254, 65, 0, 66, 0, 67, 0
3. Big Endian, output was 254, 255, 0, 65, 0, 66, 0, 67
4. Ansi, output was 65, 66, 67