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

public Class NonBlockingPumpInputStream

extends NonBlockingInputStream
Class Inheritance
Imports
java.io.IOException, .InterruptedIOException, .OutputStream, java.nio.ByteBuffer

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private boolean
private static final int
private IOException
private final OutputStream
private final ByteBuffer
private final ByteBuffer
Inherited from jdk.internal.org.jline.utils.NonBlockingInputStream:
EOFREAD_EXPIRED

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

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

protected synchronized void
public synchronized 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.

pack-priv synchronized void
public OutputStream
public synchronized int
read(long timeout, boolean isPeek)

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

public synchronized int
readBuffered(byte[] b, int off, int len, long timeout)

Overrides jdk.internal.org.jline.utils.NonBlockingInputStream.readBuffered.

private static boolean
rewind(ByteBuffer buffer, ByteBuffer other)

public synchronized void
private int
wait(ByteBuffer buffer, long timeout)

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

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

Field Detail

closedback to summary
private boolean closed
DEFAULT_BUFFER_SIZEback to summary
private static final int DEFAULT_BUFFER_SIZE

Hides java.io.InputStream.DEFAULT_BUFFER_SIZE.

ioExceptionback to summary
private IOException ioException
outputback to summary
private final OutputStream output
readBufferback to summary
private final ByteBuffer readBuffer
writeBufferback to summary
private final ByteBuffer writeBuffer

Constructor Detail

NonBlockingPumpInputStreamback to summary
public NonBlockingPumpInputStream()
NonBlockingPumpInputStreamback to summary
public NonBlockingPumpInputStream(int bufferSize)

Method Detail

availableback to summary
public synchronized 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.

checkIoExceptionback to summary
protected synchronized void checkIoException() throws IOException
closeback to summary
public synchronized 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.
flushback to summary
pack-priv synchronized void flush()
getOutputStreamback to summary
public OutputStream getOutputStream()
readback to summary
public synchronized int read(long timeout, boolean isPeek) throws IOException

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

Annotations
@Override
readBufferedback to summary
public synchronized int readBuffered(byte[] b, int off, int len, long timeout) throws IOException

Overrides jdk.internal.org.jline.utils.NonBlockingInputStream.readBuffered.

Annotations
@Override
rewindback to summary
private static boolean rewind(ByteBuffer buffer, ByteBuffer other)
setIoExceptionback to summary
public synchronized void setIoException(IOException exception)
waitback to summary
private int wait(ByteBuffer buffer, long timeout) throws IOException
writeback to summary
pack-priv synchronized void write(byte[] cbuf, int off, int len) throws IOException
jdk.internal.org.jline.utils back to summary

private Class NonBlockingPumpInputStream.NbpOutputStream

extends OutputStream
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.OutputStream.close.

Implements java.io.Closeable.close.

Closes this output stream and releases any system resources associated with this stream.

public void
flush()

Overrides java.io.OutputStream.flush.

Implements java.io.Flushable.flush.

Flushes this output stream and forces any buffered output bytes to be written out.

public void
write(int b)

Implements abstract java.io.OutputStream.write.

Writes the specified byte to this output stream.

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

Overrides java.io.OutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream.

Inherited from java.io.OutputStream:
nullOutputStreamwrite

Constructor Detail

NbpOutputStreamback to summary
private NbpOutputStream()

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.io.OutputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.OutputStream.close.

Closes this output stream and releases any system resources associated with this stream. The general contract of close is that it closes the output stream. A closed stream cannot perform output operations and cannot be reopened.

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

Overrides java.io.OutputStream.flush.

Implements java.io.Flushable.flush.

Doc from java.io.OutputStream.flush.

Flushes this output stream and forces any buffered output bytes to be written out. The general contract of flush is that calling it is an indication that, if any bytes previously written have been buffered by the implementation of the output stream, such bytes should immediately be written to their intended destination.

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(int b) throws IOException

Implements abstract java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
writeback to summary
public void write(byte[] cbuf, int off, int len) throws IOException

Overrides java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream. The general contract for write(b, off, len) is that some of the bytes in the array b are written to the output stream in order; element b[off] is the first byte written and b[off+len-1] is the last byte written by this operation.

If b is null, a NullPointerException is thrown.

If off is negative, or len is negative, or off+len is greater than the length of the array b, then an IndexOutOfBoundsException is thrown.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs. In particular, an IOException is thrown if the output stream is closed.