Reads a single character from this reader and returns it as an integer with the two higher-order bytes set to 0. Returns -1 if the end of the reader has been reached. @return the character read or -1 if the end of the reader has been reached. @throws IOException if this reader i
()
| 121 | * if this reader is closed or some other I/O error occurs. |
| 122 | */ |
| 123 | public int read() throws IOException { |
| 124 | synchronized (lock) { |
| 125 | char charArray[] = new char[1]; |
| 126 | if (read(charArray, 0, 1) != -1) { |
| 127 | return charArray[0]; |
| 128 | } |
| 129 | return -1; |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | /** |
| 134 | * Reads characters from this reader and stores them in the character array |