There r two kinds of streams ... BYTE and CHARACTER streams.
if i write a file in BYTE stream then i later read that file in CHARACTER stream.
any problem is there ???????.... i mean any character lose is there.
plz help.
kind regards.
dmjpro.
If/when you write your text using byte streams and you write ASCII characters
only (i.e. only the values 0x00 .. 0x7f) you can safely write bytes and read
chars and vice versa. This all because the first 128 byte values map to identical
values either using Unicode or ASCII.
For all other values >= 0x80 you need an en/decoding to and from Unicode chars.
A natural encoding is UTF/8. You can safely use a byte output stream for
writing UTF/8 encoded characters and read them using an UTF/8 decoder.
The same applies of course for the encoding/decoding methods.
Writing encoded bytes and reading and decoding bytes is a tedious job and
is best left to the Readers, Writers and String constructors which you can
pass the en/decoding method.
kind regards,
Jos