public int | read()Read the next decoded byte from this input stream. The byte
is returned as an int in the range 0
to 255 . If no byte is available because the end of
the stream has been reached, the value -1 is returned.
This method blocks until input data is available, the end of the
stream is detected, or an exception is thrown.
int c = in.read();
if (c == '_") // Return '_' as ' '
return ' ";
else if (c == '=") {
// QP Encoded atom. Get the next two bytes ..
ba[0] = (byte)in.read();
ba[1] = (byte)in.read();
// .. and decode them
try {
return ASCIIUtility.parseInt(ba, 0, 2, 16);
} catch (NumberFormatException nex) {
throw new DecodingException(
"QDecoder: Error in QP stream " + nex.getMessage());
}
} else
return c;
|