InputStream implementation which is populated asynchronously with ByteBuffer instances.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | BufferPipeInputStream.
A handler for events relating to the consumption of data from a |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private IOException | |
| private final BufferPipeInputStream. | |
| private final Queue |
| Access | Constructor and Description |
|---|---|
| public | BufferPipeInputStream(final BufferPipeInputStream.
the input events handler inputHandlerConstruct a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| public int | available()
Overrides java. 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. |
| private void | |
| private void | |
| public void | close()
Overrides java. Implements java. Closes this input stream and releases any system resources associated with the stream. |
| public void | push(final ByteBuffer
the buffer from which more data should be read buffer)Push a buffer into the queue. |
| public void | push(final Pooled<ByteBuffer>
the buffer from which more data should be read pooledBuffer)
References Deprecated
Pooled is deprecated or references (maybe indirectly) at least one deprecated element.
Push a buffer into the queue. |
| public void | |
| public void | |
| public int | read()
Implements abstract java. Reads the next byte of data from the input stream. |
| public int | read(final byte[]
the buffer into which the data is read. b, int the start offset in array off, int b
at which the data is written.the maximum number of bytes to read. len)Overrides java. Reads up to |
| public long | skip(long
the number of bytes to be skipped. qty)Overrides java. Skips over and discards |
| eof | back to summary |
|---|---|
| private boolean eof | |
| failure | back to summary |
|---|---|
| private IOException failure | |
| inputHandler | back to summary |
|---|---|
| private final BufferPipeInputStream. | |
| queue | back to summary |
|---|---|
| private final Queue<Pooled<ByteBuffer>> queue | |
| BufferPipeInputStream | back to summary |
|---|---|
| public BufferPipeInputStream(final BufferPipeInputStream. Construct a new instance. The given
| |
| available | back to summary |
|---|---|
| public int available() throws IOException Overrides java. Doc from java. 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 A subclass's implementation of this method may choose to throw an
| |
| checkFailure | back to summary |
|---|---|
| private void checkFailure() throws IOException | |
| clearQueue | back to summary |
|---|---|
| private void clearQueue() | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this input stream and releases any system resources associated with the stream.
| |
| push | back to summary |
|---|---|
| public void push(final ByteBuffer buffer) Push a buffer into the queue. There is no mechanism to limit the number of pushed buffers; if such a mechanism
is desired, it must be implemented externally, for example maybe using a
| |
| push | back to summary |
|---|---|
| public void push(final Pooled<ByteBuffer> pooledBuffer)
References Deprecated
See corresponding docs for further information. Push a buffer into the queue. There is no mechanism to limit the number of pushed buffers; if such a mechanism
is desired, it must be implemented externally, for example maybe using a
| |
| pushEof | back to summary |
|---|---|
| public void pushEof() Push the EOF condition into the queue. After this method is called, no further buffers may be pushed into this instance. | |
| pushException | back to summary |
|---|---|
| public void pushException(IOException e) Push an exception condition into the queue. After this method is called, no further buffers may be pushed into this instance.
| |
| read | back to summary |
|---|---|
| public int read() throws IOException Implements abstract java. Doc from java. Reads the next byte of data from the input stream. The value byte is
returned as an
| |
| read | back to summary |
|---|---|
| public int read(final byte[] b, int off, int len) throws IOException Overrides java. Doc from java. Reads up to This method blocks until input data is available, end of file is detected, or an exception is thrown. If The first byte read is stored into element In every case, elements
| |
| skip | back to summary |
|---|---|
| public long skip(long qty) throws IOException Overrides java. Doc from java. Skips over and discards
| |
BufferPipeInputStream instance.
| Modifier and Type | Method and Description |
|---|---|
| public void | acknowledge(Pooled<ByteBuffer>
the pooled resource which was consumed pooled)
References Deprecated
Pooled is deprecated or references (maybe indirectly) at least one deprecated element.
Acknowledges the successful processing of an input buffer. |
| public void | close()
Redeclares java. Signifies that the user of the enclosing |
| acknowledge | back to summary |
|---|---|
| public void acknowledge(Pooled<ByteBuffer> pooled) throws IOException
References Deprecated
See corresponding docs for further information. Acknowledges the successful processing of an input buffer. Though this method may throw an exception, it is not acted upon. The acknowledged resource is passed in, with its position set to the number of bytes consumed.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Redeclares java. Signifies that the user of the enclosing
| |