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 availa
()
| 48 | * @exception IOException if an I/O error occurs. |
| 49 | */ |
| 50 | @Override |
| 51 | public int read() throws IOException { |
| 52 | int c = in.read(); |
| 53 | |
| 54 | if (c == '_') // Return '_' as ' ' |
| 55 | return ' '; |
| 56 | else if (c == '=') { |
| 57 | // QP Encoded atom. Get the next two bytes .. |
| 58 | ba[0] = (byte)in.read(); |
| 59 | ba[1] = (byte)in.read(); |
| 60 | // .. and decode them |
| 61 | try { |
| 62 | return ASCIIUtility.parseInt(ba, 0, 2, 16); |
| 63 | } catch (NumberFormatException nex) { |
| 64 | throw new DecodingException( |
| 65 | "QDecoder: Error in QP stream " + nex.getMessage()); |
| 66 | } |
| 67 | } else |
| 68 | return c; |
| 69 | } |
| 70 | } |
no test coverage detected