APIdia Launch Partner
Top Inners Constructors Methods
jdk.internal.org.jline.utils

public Class NonBlocking

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, .Reader, java.nio.ByteBuffer, .CharBuffer, java.nio.charset.Charset, .CharsetDecoder, .CharsetEncoder, .CodingErrorAction

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static NonBlockingInputStream
nonBlocking(String name, InputStream inputStream)

public static NonBlockingReader
nonBlocking(String name, Reader reader)

public static NonBlockingReader
nonBlocking(String name, InputStream inputStream, Charset encoding)

public static NonBlockingPumpInputStream
public static NonBlockingPumpInputStream
public static NonBlockingPumpReader
public static NonBlockingPumpReader
public static NonBlockingInputStream
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NonBlockingback to summary
public NonBlocking()

Method Detail

nonBlockingback to summary
public static NonBlockingInputStream nonBlocking(String name, InputStream inputStream)
nonBlockingback to summary
public static NonBlockingReader nonBlocking(String name, Reader reader)
nonBlockingback to summary
public static NonBlockingReader nonBlocking(String name, InputStream inputStream, Charset encoding)
nonBlockingPumpInputStreamback to summary
public static NonBlockingPumpInputStream nonBlockingPumpInputStream()
nonBlockingPumpInputStreamback to summary
public static NonBlockingPumpInputStream nonBlockingPumpInputStream(int size)
nonBlockingPumpReaderback to summary
public static NonBlockingPumpReader nonBlockingPumpReader()
nonBlockingPumpReaderback to summary
public static NonBlockingPumpReader nonBlockingPumpReader(int size)
nonBlockingStreamback to summary
public static NonBlockingInputStream nonBlockingStream(NonBlockingReader reader, Charset encoding)
jdk.internal.org.jline.utils back to summary

private Class NonBlocking.NonBlockingInputStreamReader

extends NonBlockingReader
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final ByteBuffer
private final CharBuffer
private final CharsetDecoder
private final NonBlockingInputStream
Inherited from jdk.internal.org.jline.utils.NonBlockingReader:
EOFREAD_EXPIRED

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements abstract java.io.Reader.close.

Implements java.io.Closeable.close.

Closes the stream and releases any system resources associated with it.

protected int
read(long timeout, boolean isPeek)

Implements abstract jdk.internal.org.jline.utils.NonBlockingReader.read.

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.internal.org.jline.utils.NonBlockingReader.readBuffered.

public void
shutdown()

Overrides jdk.internal.org.jline.utils.NonBlockingReader.shutdown.

Shuts down the thread that is handling blocking I/O.

Inherited from jdk.internal.org.jline.utils.NonBlockingReader:
availablepeekreadreadreadreadBufferedreadBuffered

Field Detail

bytesback to summary
private final ByteBuffer bytes
charsback to summary
private final CharBuffer chars
decoderback to summary
private final CharsetDecoder decoder
inputback to summary
private final NonBlockingInputStream input

Constructor Detail

NonBlockingInputStreamReaderback to summary
public NonBlockingInputStreamReader(NonBlockingInputStream inputStream, Charset encoding)
NonBlockingInputStreamReaderback to summary
public NonBlockingInputStreamReader(NonBlockingInputStream input, CharsetDecoder decoder)

Method Detail

closeback to summary
public void close() throws IOException

Implements abstract java.io.Reader.close.

Implements java.io.Closeable.close.

Doc from java.io.Reader.close.

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.

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
readback to summary
protected int read(long timeout, boolean isPeek) throws IOException

Implements abstract jdk.internal.org.jline.utils.NonBlockingReader.read.

Doc from jdk.internal.org.jline.utils.NonBlockingReader.read.

Attempts to read a character from the input stream for a specific period of time.

Annotations
@Override
Exceptions
IOException:
if anything wrong happens
readBufferedback to summary
public int readBuffered(char[] b, int off, int len, long timeout) throws IOException

Implements abstract jdk.internal.org.jline.utils.NonBlockingReader.readBuffered.

Annotations
@Override
shutdownback to summary
public void shutdown()

Overrides jdk.internal.org.jline.utils.NonBlockingReader.shutdown.

Doc from jdk.internal.org.jline.utils.NonBlockingReader.shutdown.

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.

Annotations
@Override
jdk.internal.org.jline.utils back to summary

private Class NonBlocking.NonBlockingReaderInputStream

extends NonBlockingInputStream
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final ByteBuffer
private final CharBuffer
private final CharsetEncoder
private final NonBlockingReader
Inherited from jdk.internal.org.jline.utils.NonBlockingInputStream:
EOFREAD_EXPIRED

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
available()

Overrides java.io.InputStream.available.

Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking, which may be 0, or 0 when end of stream is detected.

public void
close()

Overrides java.io.InputStream.close.

Implements java.io.Closeable.close.

Closes this input stream and releases any system resources associated with the stream.

public int
read(long timeout, boolean isPeek)

Implements abstract jdk.internal.org.jline.utils.NonBlockingInputStream.read.

Inherited from jdk.internal.org.jline.utils.NonBlockingInputStream:
peekreadreadreadreadBufferedreadBufferedreadBufferedshutdown

Field Detail

bytesback to summary
private final ByteBuffer bytes
charsback to summary
private final CharBuffer chars
encoderback to summary
private final CharsetEncoder encoder
readerback to summary
private final NonBlockingReader reader

Constructor Detail

NonBlockingReaderInputStreamback to summary
private NonBlockingReaderInputStream(NonBlockingReader reader, Charset charset)

Method Detail

availableback to summary
public int available()

Overrides java.io.InputStream.available.

Doc from java.io.InputStream.available.

Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking, which may be 0, or 0 when end of stream is detected. The read might be on the same thread or another thread. A single read or skip of this many bytes will not block, but may read or skip fewer bytes.

Note that while some implementations of InputStream will return the total number of bytes in the stream, many will not. It is never correct to use the return value of this method to allocate a buffer intended to hold all data in this stream.

A subclass's implementation of this method may choose to throw an IOException if this input stream has been closed by invoking the close() method.

Annotations
@Override
closeback to summary
public void close() throws IOException

Overrides java.io.InputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.InputStream.close.

Closes this input stream and releases any system resources associated with the stream.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
readback to summary
public int read(long timeout, boolean isPeek) throws IOException

Implements abstract jdk.internal.org.jline.utils.NonBlockingInputStream.read.

Annotations
@Override