< prev index next >
src/java.base/share/classes/java/io/PipedReader.java
Print this page
*** 51,61 ****
private static final int DEFAULT_PIPE_SIZE = 1024;
/**
* The circular buffer into which incoming data is placed.
*/
! char buffer[];
/**
* The index of the position in the circular buffer at which the
* next character of data will be stored when received from the connected
* piped writer. <code>in<0</code> implies the buffer is empty,
--- 51,61 ----
private static final int DEFAULT_PIPE_SIZE = 1024;
/**
* The circular buffer into which incoming data is placed.
*/
! char[] buffer;
/**
* The index of the position in the circular buffer at which the
* next character of data will be stored when received from the connected
* piped writer. <code>in<0</code> implies the buffer is empty,
*** 199,209 ****
/**
* Receives data into an array of characters. This method will
* block until some input is available.
*/
! synchronized void receive(char c[], int off, int len) throws IOException {
while (--len >= 0) {
receive(c[off++]);
}
}
--- 199,209 ----
/**
* Receives data into an array of characters. This method will
* block until some input is available.
*/
! synchronized void receive(char[] c, int off, int len) throws IOException {
while (--len >= 0) {
receive(c[off++]);
}
}
*** 286,296 ****
* <a href=PipedInputStream.html#BROKEN> <code>broken</code></a>,
* {@link #connect(java.io.PipedWriter) unconnected}, closed,
* or an I/O error occurs.
* @exception IndexOutOfBoundsException {@inheritDoc}
*/
! public synchronized int read(char cbuf[], int off, int len) throws IOException {
if (!connected) {
throw new IOException("Pipe not connected");
} else if (closedByReader) {
throw new IOException("Pipe closed");
} else if (writeSide != null && !writeSide.isAlive()
--- 286,296 ----
* <a href=PipedInputStream.html#BROKEN> <code>broken</code></a>,
* {@link #connect(java.io.PipedWriter) unconnected}, closed,
* or an I/O error occurs.
* @exception IndexOutOfBoundsException {@inheritDoc}
*/
! public synchronized int read(char[] cbuf, int off, int len) throws IOException {
if (!connected) {
throw new IOException("Pipe not connected");
} else if (closedByReader) {
throw new IOException("Pipe closed");
} else if (writeSide != null && !writeSide.isAlive()
< prev index next >