Reads up to
len
characters of data from this piped
stream into an array of characters. Less than
len
characters
will be read if the end of the data stream is reached or if
len
exceeds the pipe's buffer size. This method
blocks until at least one character of input is available.
Returns:
the total number of characters read into the buffer, or
-1
if there is no more data because the end of
the stream has been reached.
Parameters:
-
cbuf - the buffer into which the data is read.
-
off - the start offset of the data.
-
len - the maximum number of characters read.
Throws:
-
IOException - if the pipe is
broken
,
{@link #connect(java.io.PipedWriter) unconnected}, closed,
or an I/O error occurs.