Reads a single byte from this stream and returns it as an integer in the range from 0 to 255. Returns -1 if the end of this stream has been reached. @return the byte read or -1 if the end of this stream has been reached. @throws IOException if this stream is closed or another I/O error
()
| 222 | * if this stream is closed or another I/O error occurs. |
| 223 | */ |
| 224 | @Override |
| 225 | public int read() throws IOException { |
| 226 | byte[] readed = new byte[1]; |
| 227 | int result = read(readed, 0, 1); |
| 228 | return result == -1 ? -1 : readed[0] & 0xff; |
| 229 | } |
| 230 | |
| 231 | /** |
| 232 | * Reads bytes from this stream and stores them in the byte array |