dataReceived and close may be safely invoked by multiple threads. The other methods must be invoked only by one thread, which is the reader of this data stream.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| protected final Connection | |
| private static final boolean | |
| protected final Input | |
| protected final AtomicBoolean | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| protected | AbstractStreamReader(Connection<L>
the connection, Input Connection to be associated with this AbstractStreamReaderthe stream source streamInput)Create a new ByteBufferReader. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public int | available()
Implements org. Return the number of bytes available for get calls. |
| public void | close()
Implements java. Closes the StreamReader and causes all subsequent method calls on this object to throw IllegalStateException. |
| public <E> GrizzlyFuture | decode(Transformer<Stream, E> decoder)
Implements org. Read and decode data from the StreamReader |
| public <E> GrizzlyFuture | decode(Transformer<Stream, E> decoder, CompletionHandler<E> completionHandler)
Implements org. Read and decode data from the StreamReader |
| public Buffer | |
| public Connection | getConnection()
Implements org. Get the |
| public final boolean | hasAvailable()
Implements org. Return true if StreamReader has available data, which could be read, or false otherwise. |
| public boolean | isClosed()
Implements org. Returns true, if StreamReader has been closed, or false otherwise. |
| public boolean | |
| public GrizzlyFuture | notifyAvailable(int size)
Implements org. Method returns |
| public GrizzlyFuture | notifyAvailable(final int size, CompletionHandler<Integer> completionHandler)
Implements org. Method returns |
| public GrizzlyFuture | notifyCondition(Condition condition)
Implements org. Method returns |
| public synchronized GrizzlyFuture | notifyCondition(final Condition condition, final CompletionHandler<Integer> completionHandler)
Implements org. Method returns |
| public boolean | readBoolean()
Implements org. Get the next boolean in the stream. |
| public void | readBooleanArray(boolean[] data)
Implements org. Fill data with booleans (byte 1=true, 0=false) from the stream. |
| public byte | readByte()
Implements org. Get the next byte in the stream. |
| public void | readByteArray(final byte[] data)
Implements org. Fill data with bytes from the stream. |
| public void | readByteArray(byte[] data, int offset, int length)
Implements org. Fill data with bytes from the stream. |
| public void | readBytes(final Buffer buffer)
Implements org. Fill the buffer with data from the stream (that is, copy data from the stream to fill buffer from position to limit). |
| public char | readChar()
Implements org. Get the next character in the stream. |
| public void | readCharArray(final char[] data)
Implements org. Fill data with characters from the stream. |
| public final double | readDouble()
Implements org. Get the next double in the stream. |
| public void | readDoubleArray(final double[] data)
Implements org. Fill data with characters from the stream. |
| public final float | readFloat()
Implements org. Get the next float in the stream. |
| public void | readFloatArray(final float[] data)
Implements org. Fill data with characters from the stream. |
| public int | readInt()
Implements org. Get the next int in the stream. |
| public void | readIntArray(final int[] data)
Implements org. Fill data with characters from the stream. |
| public long | readLong()
Implements org. Get the next long in the stream. |
| public void | readLongArray(final long[] data)
Implements org. Fill data with characters from the stream. |
| public short | readShort()
Implements org. Get the next short in the stream. |
| public void | readShortArray(final short[] data)
Implements org. Fill data with characters from the stream. |
| public void | |
| public Buffer |
| connection | back to summary |
|---|---|
| protected final Connection<L> connection | |
| DEBUG | back to summary |
|---|---|
| private static final boolean DEBUG | |
| input | back to summary |
|---|---|
| protected final Input input | |
| isClosed | back to summary |
|---|---|
| protected final AtomicBoolean isClosed | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| AbstractStreamReader | back to summary |
|---|---|
| protected AbstractStreamReader(Connection<L> connection, Input streamInput) Create a new ByteBufferReader.
| |
| arraySizeCheck | back to summary |
|---|---|
| private void arraySizeCheck(final int sizeInBytes) | |
| available | back to summary |
|---|---|
| public int available() Implements org. Doc from org. Return the number of bytes available for get calls. An attempt to get more data than is present in the stream will either result in blocking (if isBlocking() returns true) or a BufferUnderflowException.
| |
| close | back to summary |
|---|---|
| public void close() Implements java. Closes the StreamReader and causes all subsequent method calls on this object to throw IllegalStateException.
| |
| decode | back to summary |
|---|---|
| public <E> GrizzlyFuture Implements org. Doc from org. Read and decode data from the StreamReader
| |
| decode | back to summary |
|---|---|
| public <E> GrizzlyFuture Implements org. Doc from org. Read and decode data from the StreamReader
| |
| getBufferWindow | back to summary |
|---|---|
| public Buffer getBufferWindow() Implements org.
| |
| getConnection | back to summary |
|---|---|
| public Connection Implements org. Doc from org. Get the
| |
| hasAvailable | back to summary |
|---|---|
| public final boolean hasAvailable() Implements org. Doc from org. Return true if StreamReader has available data, which could be read, or false otherwise.
| |
| isClosed | back to summary |
|---|---|
| public boolean isClosed() Implements org. Doc from org. Returns true, if StreamReader has been closed, or false otherwise.
| |
| isSupportBufferWindow | back to summary |
|---|---|
| public boolean isSupportBufferWindow() Implements org.
| |
| notifyAvailable | back to summary |
|---|---|
| public GrizzlyFuture Implements org. Doc from org. Method returns
| |
| notifyAvailable | back to summary |
|---|---|
| public GrizzlyFuture Implements org. Doc from org. Method returns
| |
| notifyCondition | back to summary |
|---|---|
| public GrizzlyFuture Implements org. Doc from org. Method returns
| |
| notifyCondition | back to summary |
|---|---|
| public synchronized GrizzlyFuture Implements org. Doc from org. Method returns
| |
| readBoolean | back to summary |
|---|---|
| public boolean readBoolean() throws IOException Implements org. Doc from org. Get the next boolean in the stream. Requires 1 byte.
| |
| readBooleanArray | back to summary |
|---|---|
| public void readBooleanArray(boolean[] data) throws IOException Implements org. Doc from org. Fill data with booleans (byte 1=true, 0=false) from the stream. If this method returns normally, data has been filled completely. Requires data.length bytes.
| |
| readByte | back to summary |
|---|---|
| public byte readByte() throws IOException Implements org. Doc from org. Get the next byte in the stream. Requires 1 byte.
| |
| readByteArray | back to summary |
|---|---|
| public void readByteArray(final byte[] data) throws IOException Implements org. Doc from org. Fill data with bytes from the stream. If this method returns normally, data has been filled completely. Requires data.length bytes.
| |
| readByteArray | back to summary |
|---|---|
| public void readByteArray(byte[] data, int offset, int length) throws IOException Implements org. Doc from org. Fill data with bytes from the stream. If this method returns normally, data has been filled completely. Requires data.length bytes.
| |
| readBytes | back to summary |
|---|---|
| public void readBytes(final Buffer buffer) throws IOException Implements org. Doc from org. Fill the buffer with data from the stream (that is, copy data from the stream to fill buffer from position to limit). This is useful when data must be read from one stream and then added to another stream for further processing.
| |
| readChar | back to summary |
|---|---|
| public char readChar() throws IOException Implements org. Doc from org. Get the next character in the stream. Requires 2 bytes.
| |
| readCharArray | back to summary |
|---|---|
| public void readCharArray(final char[] data) throws IOException Implements org. Doc from org. Fill data with characters from the stream. If this method returns normally, data has been filled completely. Requires 2*data.length bytes.
| |
| readDouble | back to summary |
|---|---|
| public final double readDouble() throws IOException Implements org. Doc from org. Get the next double in the stream. Requires 8 bytes.
| |
| readDoubleArray | back to summary |
|---|---|
| public void readDoubleArray(final double[] data) throws IOException Implements org. Doc from org. Fill data with characters from the stream. If this method returns normally, data has been filled completely. Requires 8*data.length bytes.
| |
| readFloat | back to summary |
|---|---|
| public final float readFloat() throws IOException Implements org. Doc from org. Get the next float in the stream. Requires 4 bytes.
| |
| readFloatArray | back to summary |
|---|---|
| public void readFloatArray(final float[] data) throws IOException Implements org. Doc from org. Fill data with characters from the stream. If this method returns normally, data has been filled completely. Requires 4*data.length bytes.
| |
| readInt | back to summary |
|---|---|
| public int readInt() throws IOException Implements org. Doc from org. Get the next int in the stream. Requires 4 bytes.
| |
| readIntArray | back to summary |
|---|---|
| public void readIntArray(final int[] data) throws IOException Implements org. Doc from org. Fill data with characters from the stream. If this method returns normally, data has been filled completely. Requires 4*data.length bytes.
| |
| readLong | back to summary |
|---|---|
| public long readLong() throws IOException Implements org. Doc from org. Get the next long in the stream. Requires 8 bytes.
| |
| readLongArray | back to summary |
|---|---|
| public void readLongArray(final long[] data) throws IOException Implements org. Doc from org. Fill data with characters from the stream. If this method returns normally, data has been filled completely. Requires 8*data.length bytes.
| |
| readShort | back to summary |
|---|---|
| public short readShort() throws IOException Implements org. Doc from org. Get the next short in the stream. Requires 2 bytes.
| |
| readShortArray | back to summary |
|---|---|
| public void readShortArray(final short[] data) throws IOException Implements org. Doc from org. Fill data with characters from the stream. If this method returns normally, data has been filled completely. Requires 2*data.length bytes.
| |
| skip | back to summary |
|---|---|
| public void skip(int length) Implements org.
| |
| takeBufferWindow | back to summary |
|---|---|
| public Buffer takeBufferWindow() Implements org.
| |
| Modifier and Type | Field and Description |
|---|---|
| private volatile A |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected A | |
| public void |
| result | back to summary |
|---|---|
| private volatile A result | |
| DecodeCompletionHandler | back to summary |
|---|---|
| public DecodeCompletionHandler(FutureImpl<A> future, CompletionHandler<A> completionHandler) | |
| adapt | back to summary |
|---|---|
| protected A adapt(B result) Overrides org.
| |
| setResult | back to summary |
|---|---|
| public void setResult(A result) Implements org.
| |