123 |
* This stream is then ready for reading. If this stream is already |
* This stream is then ready for reading. If this stream is already |
124 |
* connected or has been previously closed, then an exception is thrown |
* connected or has been previously closed, then an exception is thrown |
125 |
* |
* |
126 |
* @param src The <code>PipedWriter</code> to connect this stream to |
* @param source The <code>PipedWriter</code> to connect this stream to |
127 |
* |
* |
128 |
* @exception IOException If this PipedReader or <code>source</code> |
* @exception IOException If this PipedReader or <code>source</code> |
129 |
* has been connected already. |
* has been connected already. |
218 |
* because the end of the stream was reached. If the stream is already |
* because the end of the stream was reached. If the stream is already |
219 |
* closed, a -1 will again be returned to indicate the end of the stream. |
* closed, a -1 will again be returned to indicate the end of the stream. |
220 |
* <p> |
* <p> |
221 |
* This method will block if no chars are available to be read. |
* This method will block if no char is available to be read. |
|
* |
|
|
* @param buf The buffer into which chars will be stored |
|
|
* @param offset The index into the buffer at which to start writing. |
|
|
* @param len The maximum number of chars to read. |
|
222 |
*/ |
*/ |
223 |
public int read() throws IOException |
public int read() throws IOException |
224 |
{ |
{ |
229 |
// if this method is never called. |
// if this method is never called. |
230 |
|
|
231 |
int r = read(read_buf, 0, 1); |
int r = read(read_buf, 0, 1); |
232 |
|
return r != -1 ? read_buf[0] : -1; |
|
if (r == -1) |
|
|
return -1; |
|
|
else |
|
|
return read_buf[0]; |
|
233 |
} |
} |
234 |
|
|
235 |
/** |
/** |