Bytes and Chars plus encoding
Hi,
I have a requirement to read bytes and at times characters from a given input stream. The characters in the input stream may be encoded in a particular encoding. I have a definition file, for the input stream I am supposed to read, which tells when and how much bytes/chars is to be read. Java allows to read eihter bytes or characters from a given stream. How can I read both from a given input stream?
For example, I want something like:
InputStream myInputStream;
int b = myInputStream.readByte();
// the character read below should be decoded using the appropriate
// encoding, which is known from the definition file.
int c = myInputStream.readChar();
Thanks,
Rahul.

