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

public Class NonBlockingPumpReader

extends NonBlockingReader
Class Inheritance
Imports
java.io.IOException, .InterruptedIOException, .Writer, java.util.concurrent.TimeUnit, java.util.concurrent.locks.Condition, .ReentrantLock

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final char[]
private boolean
private int
private static final int
pack-priv final ReentrantLock
lock

Hides java.io.Reader.lock.

Main lock guarding all access
private final Condition
notEmpty

Condition for waiting takes

private final Condition
notFull

Condition for waiting puts

private int
private int
private final Writer
Inherited from jdk.internal.org.jline.utils.NonBlockingReader:
EOFREAD_EXPIRED

Constructor Summary

AccessConstructor and Description
public
public
NonBlockingPumpReader(int bufferSize)

Method Summary

Modifier and TypeMethod and Description
public int
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.

public Writer
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 boolean
ready()

Overrides java.io.Reader.ready.

Tells whether this stream is ready to be read.

pack-priv void
write(char[] cbuf, int off, int len)

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

Field Detail

bufferback to summary
private final char[] buffer
closedback to summary
private boolean closed
countback to summary
private int count
DEFAULT_BUFFER_SIZEback to summary
private static final int DEFAULT_BUFFER_SIZE
lockback to summary
pack-priv final ReentrantLock lock

Hides java.io.Reader.lock.

Main lock guarding all access

notEmptyback to summary
private final Condition notEmpty

Condition for waiting takes

notFullback to summary
private final Condition notFull

Condition for waiting puts

readback to summary
private int read
writeback to summary
private int write
writerback to summary
private final Writer writer

Constructor Detail

NonBlockingPumpReaderback to summary
public NonBlockingPumpReader()
NonBlockingPumpReaderback to summary
public NonBlockingPumpReader(int bufferSize)

Method Detail

availableback to summary
public int available()

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

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
getWriterback to summary
public Writer getWriter()
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
readyback to summary
public boolean ready()

Overrides java.io.Reader.ready.

Doc from java.io.Reader.ready.

Tells whether this stream is ready to be read.

Annotations
@Override
writeback to summary
pack-priv void write(char[] cbuf, int off, int len) throws IOException
jdk.internal.org.jline.utils back to summary

private Class NonBlockingPumpReader.NbpWriter

extends Writer
Class Inheritance

Field Summary

Inherited from java.io.Writer:
lock

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements abstract java.io.Writer.close.

Implements java.io.Closeable.close.

Closes the stream, flushing it first.

public void
flush()

Implements abstract java.io.Writer.flush.

Implements java.io.Flushable.flush.

Flushes the stream.

public void
write(char[] cbuf, int off, int len)

Implements abstract java.io.Writer.write.

Writes a portion of an array of characters.

Inherited from java.io.Writer:
appendappendappendnullWriterwritewritewritewrite

Constructor Detail

NbpWriterback to summary
private NbpWriter()

Method Detail

closeback to summary
public void close() throws IOException

Implements abstract java.io.Writer.close.

Implements java.io.Closeable.close.

Doc from java.io.Writer.close.

Closes the stream, flushing it first. Once the stream has been closed, further write() or flush() invocations will cause an IOException to be thrown. Closing a previously closed stream has no effect.

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
flushback to summary
public void flush() throws IOException

Implements abstract java.io.Writer.flush.

Implements java.io.Flushable.flush.

Doc from java.io.Writer.flush.

Flushes the stream. If the stream has saved any characters from the various write() methods in a buffer, write them immediately to their intended destination. Then, if that destination is another character or byte stream, flush it. Thus one flush() invocation will flush all the buffers in a chain of Writers and OutputStreams.

If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
writeback to summary
public void write(char[] cbuf, int off, int len) throws IOException

Implements abstract java.io.Writer.write.

Doc from java.io.Writer.write.

Writes a portion of an array of characters.

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs