VERY IMPORTANT NOTES
shutdown() method must be called in order to shut down
the thread that handles blocking I/O.
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private IOException | |
| private Reader | |
| private String | |
| public static final int | |
| private Thread | |
| private long | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | NonBlockingReaderImpl(String
The reader name name, Reader The reader to wrap in)Creates a |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | |
| public void | close()
Implements abstract java. Implements java. Closes the stream and releases any system resources associated with it. |
| protected synchronized int | Returns: The character read, -1 if EOF is reached, or -2 if the read timed out.The amount of time to wait for the character timeout, boolean isPeek)Implements abstract jdk. Attempts to read a character from the input stream for a specific period of time. |
| public int | readBuffered(char[] b, int off, int len, long timeout)
Implements abstract jdk.
|
| public synchronized boolean | |
| private void | |
| public synchronized void | shutdown()
Overrides jdk. Shuts down the thread that is handling blocking I/O. |
| private synchronized void |
| ch | back to summary |
|---|---|
| private int ch | |
| exception | back to summary |
|---|---|
| private IOException exception | |
| in | back to summary |
|---|---|
| private Reader in | |
| name | back to summary |
|---|---|
| private String name | |
| READ_EXPIRED | back to summary |
|---|---|
| public static final int READ_EXPIRED Hides jdk. | |
| thread | back to summary |
|---|---|
| private Thread thread | |
| threadDelay | back to summary |
|---|---|
| private long threadDelay | |
| threadIsReading | back to summary |
|---|---|
| private boolean threadIsReading | |
| NonBlockingReaderImpl | back to summary |
|---|---|
| public NonBlockingReaderImpl(String name, Reader in) Creates a | |
| clear | back to summary |
|---|---|
| public synchronized void clear() throws IOException | |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements abstract java. Implements java. Doc from java. Closes the stream and releases any system resources associated with it. Once the stream has been closed, further read(), ready(), mark(), reset(), or skip() invocations will throw an IOException. Closing a previously closed stream has no effect.
| |
| read | back to summary |
|---|---|
| protected synchronized int read(long timeout, boolean isPeek) throws IOException Implements abstract jdk. Attempts to read a character from the input stream for a specific period of time.
| |
| readBuffered | back to summary |
|---|---|
| public int readBuffered(char[] b, int off, int len, long timeout) throws IOException Implements abstract jdk.
| |
| ready | back to summary |
|---|---|
| public synchronized boolean ready() throws IOException Overrides java. Doc from java. Tells whether this stream is ready to be read.
| |
| run | back to summary |
|---|---|
| private void run() | |
| shutdown | back to summary |
|---|---|
| public synchronized void shutdown() Overrides jdk. Shuts down the thread that is handling blocking I/O. Note that if the thread is currently blocked waiting for I/O it will not actually shut down until the I/O is received. | |
| startReadingThreadIfNeeded | back to summary |
|---|---|
| private synchronized void startReadingThreadIfNeeded() | |