I understand that byte streams deal with bytes and character streams deal with characters... if I use a byte stream to read in characters, could this limit me to the sorts of characters I might read? For instance, bytes are read in as 8 bit bytes, characters are read in as 16 bit characters... does this mean that more characters can be represented using character streams rather than byte streams?
The last thing im confused about is how a byte stream writes out to a file for reading. If I was recieving bytes from a network socket, I would wrap them in a InputStreamReader
for writing, this way I would get the character transformation logic the character stream provides. If I read from a file using a FileInputStream
and write out using a FileOutputStream
, why is this file readable when I open it with a text editor? How is the FileOutputStream
treating the bytes?