| Modifier and Type | Field and Description |
|---|---|
| private float | averageCharsPerByte
Used to estimate how many characters can be produced from a variable number of bytes. |
| private boolean | closed
Flag indicating whether or not this |
| private Connection | connection
The |
| private boolean | contentRead
Flag indicating all request content has been read. |
| private FilterChainContext | ctx
The |
| private CharsetDecoder | decoder
The |
| private final Map | decoders
CharsetDecoders cache |
| private String | encoding
The default character encoding to use if none is specified by the
|
| private volatile ReadHandler | handler
The |
| private HttpHeader | httpHeader
The |
| private Buffer | inputContentBuffer
The |
| private boolean | isWaitingDataAsynchronously
Flag shows if we're currently waiting for input data asynchronously (is OP_READ enabled for the Connection) |
| private static final Logger | |
| private static final Level | |
| private int | markPos
The mark position within the current binary content. |
| private boolean | processingChars
Flag indicating whether or not this |
| private int | readAheadLimit
Represents how many bytes can be read before |
| private int | readCount
Counter to track how many bytes have been read. |
| private int | requestedSize
The length of the content that must be read before notifying the |
| private final CharBuffer | singleCharBuf
|
| protected Map | trailers
Trailer headers, if any. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | append(final HttpContent
the httpContent)HttpContent to appendAppends the specified |
| public boolean | |
| public int | |
| public int | |
| protected HttpContent | |
| private static void | checkHttpTrailer(final HttpContent httpContent)
Check if passed |
| private boolean | checkMarkAfterRead(final long
read bytes count n)Returns: true if mark is still active, or false if the mark hasn't been set or has been invalidated |
| public void | |
| private int | Returns: the number of bytes actually readhow much content should attempt to be read, requestedLen)-1 means read till the end of the
message.
Used to add additional HTTP message chunk content to |
| private int | Returns: the number of chars actually readhow much content should attempt to be read requestedLen, final CharBuffer dst)Used to convert pre-read (buffered) bytes to chars. |
| private int | Returns: the number of chars actually readhow much content should attempt to be read requestedLen, final CharBuffer dst)Used to convert bytes to chars. |
| public void | fillFully(final int
how much content should attempt to buffer, length)-1 means buffer entire request./** Fill the buffer (blocking) up to the requested length. |
| protected void | finished()
When invoked, this method will call |
| private void | |
| public Buffer | |
| private CharsetDecoder | getDecoder()
Returns: the |
| public ReadHandler | |
| protected Executor | |
| public Map | |
| public void | initialize(final HttpHeader
the header from which input will be obtained. httpHeader, final FilterChainContext the FilterChainContext for the chain processing this request ctx)Per-request initialization required for the InputBuffer to function properly. |
| public void | |
| private void | |
| private void | invokeHandler(final ReadHandler localHandler, final boolean invokeDataAvailable, final boolean isLast)
|
| private void | |
| private void | invokeHandlerOnProperThread(final ReadHandler localHandler, final boolean invokeDataAvailable, final boolean isLast)
|
| public boolean | isAsyncEnabled()
Deprecated
will always return true
Returns: if this buffer is being used to process asynchronous data. |
| public boolean | |
| public boolean | |
| private static void | |
| public void | |
| public boolean | |
| public void | notifyAvailable(final ReadHandler
the handler)ReadHandler to invoke.Installs a |
| public void | notifyAvailable(final ReadHandler
the handler, final int ReadHandler to invoke.the minimum number of bytes that must be available before the size)ReadHandler is notified.Installs a |
| public void | processingChars()
This method should be called if the InputBuffer is being used in conjunction with a |
| private void | |
| public int | |
| public int | |
| public int | |
| public Buffer | |
| public Buffer | readBuffer(final int
the requested size of the size)Buffer to be returned.Returns: the |
| public int | |
| public int | |
| public boolean | |
| public int | Returns: depending on the InputBuffer mode, method will return either number of available bytes or characters ready to be read without blocking.Depending on the InputBuffer mode, method will return either number of available bytes or characters ready to be read without blocking. |
| public void | |
| public void | |
| public void | |
| public void | setAsyncEnabled(boolean
true if this InputBuffer
Deprecated
Sets the asynchronous processing state of this |
| public void | setDefaultEncoding(final String encoding)
Set the default character encoding for this InputBuffer, which would be applied if no encoding was
explicitly set on HTTP |
| private static boolean | shouldNotifyNow(final int
the amount of data that must be available for a size, final int ReadHandler to be notified.the amount of data currently available. available)Returns: |
| public long | skip(final long n, final boolean block)
Deprecated
pls. use
skip(long), the block parameter will be ignored
Skips the specified number of bytes/characters. |
| public long | |
| public void | terminate()
Invoke |
| private CompositeBuffer | |
| protected void |
| averageCharsPerByte | back to summary |
|---|---|
| private float averageCharsPerByte Used to estimate how many characters can be produced from a variable number of bytes. | |
| closed | back to summary |
|---|---|
| private boolean closed Flag indicating whether or not this | |
| connection | back to summary |
|---|---|
| private Connection<L> connection The | |
| contentRead | back to summary |
|---|---|
| private boolean contentRead Flag indicating all request content has been read. | |
| ctx | back to summary |
|---|---|
| private FilterChainContext ctx The | |
| decoder | back to summary |
|---|---|
| private CharsetDecoder decoder The | |
| decoders | back to summary |
|---|---|
| private final Map<String, CharsetDecoder> decoders CharsetDecoders cache | |
| encoding | back to summary |
|---|---|
| private String encoding The default character encoding to use if none is specified by the
| |
| handler | back to summary |
|---|---|
| private volatile ReadHandler handler The | |
| httpHeader | back to summary |
|---|---|
| private HttpHeader httpHeader The | |
| inputContentBuffer | back to summary |
|---|---|
| private Buffer inputContentBuffer The | |
| isWaitingDataAsynchronously | back to summary |
|---|---|
| private boolean isWaitingDataAsynchronously Flag shows if we're currently waiting for input data asynchronously (is OP_READ enabled for the Connection) | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| LOGGER_LEVEL | back to summary |
|---|---|
| private static final Level LOGGER_LEVEL | |
| markPos | back to summary |
|---|---|
| private int markPos The mark position within the current binary content. Marking is not supported for character content. | |
| processingChars | back to summary |
|---|---|
| private boolean processingChars Flag indicating whether or not this | |
| readAheadLimit | back to summary |
|---|---|
| private int readAheadLimit Represents how many bytes can be read before | |
| readCount | back to summary |
|---|---|
| private int readCount Counter to track how many bytes have been read. This counter is only used with the byte stream has been marked. | |
| requestedSize | back to summary |
|---|---|
| private int requestedSize The length of the content that must be read before notifying the | |
| singleCharBuf | back to summary |
|---|---|
| private final CharBuffer singleCharBuf
| |
| trailers | back to summary |
|---|---|
| protected Map<String, String> trailers Trailer headers, if any. | |
| InputBuffer | back to summary |
|---|---|
| public InputBuffer() | |
| append | back to summary |
|---|---|
| public boolean append(final HttpContent httpContent) throws IOException Appends the specified
| |
| areTrailersAvailable | back to summary |
|---|---|
| public boolean areTrailersAvailable() | |
| available | back to summary |
|---|---|
public int available()
| |
| availableChar | back to summary |
|---|---|
| public int availableChar() | |
| blockingRead | back to summary |
|---|---|
| protected HttpContent blockingRead() throws IOException Read next chunk of data in this thread, block if needed.
| |
| checkHttpTrailer | back to summary |
|---|---|
| private static void checkHttpTrailer(final HttpContent httpContent) Check if passed | |
| checkMarkAfterRead | back to summary |
|---|---|
private boolean checkMarkAfterRead(final long n)
| |
| close | back to summary |
|---|---|
public void close() throws IOException
| |
| fill | back to summary |
|---|---|
| private int fill(final int requestedLen) throws IOException
Used to add additional HTTP message chunk content to
| |
| fillAvailableChars | back to summary |
|---|---|
| private int fillAvailableChars(final int requestedLen, final CharBuffer dst) Used to convert pre-read (buffered) bytes to chars.
| |
| fillChars | back to summary |
|---|---|
| private int fillChars(final int requestedLen, final CharBuffer dst) throws IOException Used to convert bytes to chars.
| |
| fillFully | back to summary |
|---|---|
| public void fillFully(final int length) throws IOException /** Fill the buffer (blocking) up to the requested length.
| |
| finished | back to summary |
|---|---|
| protected void finished() When invoked, this method will call | |
| finishedInTheCurrentThread | back to summary |
|---|---|
| private void finishedInTheCurrentThread(final ReadHandler readHandler) | |
| getBuffer | back to summary |
|---|---|
| public Buffer getBuffer() Returns the duplicate of the underlying | |
| getDecoder | back to summary |
|---|---|
private CharsetDecoder getDecoder()
| |
| getReadHandler | back to summary |
|---|---|
public ReadHandler getReadHandler()
| |
| getThreadPool | back to summary |
|---|---|
protected Executor getThreadPool()
| |
| getTrailers | back to summary |
|---|---|
| public Map | |
| initialize | back to summary |
|---|---|
| public void initialize(final HttpHeader httpHeader, final FilterChainContext ctx) Per-request initialization required for the InputBuffer to function properly.
| |
| initiateAsyncronousDataReceiving | back to summary |
|---|---|
| public void initiateAsyncronousDataReceiving() Initiates asynchronous data receiving. This is service method, usually users don't have to call it explicitly. | |
| invokeErrorHandlerOnProperThread | back to summary |
|---|---|
| private void invokeErrorHandlerOnProperThread(final ReadHandler localHandler, final Throwable error) | |
| invokeHandler | back to summary |
|---|---|
| private void invokeHandler(final ReadHandler localHandler, final boolean invokeDataAvailable, final boolean isLast) | |
| invokeHandlerAllRead | back to summary |
|---|---|
| private void invokeHandlerAllRead(final ReadHandler readHandler, final Executor executor) | |
| invokeHandlerOnProperThread | back to summary |
|---|---|
| private void invokeHandlerOnProperThread(final ReadHandler localHandler, final boolean invokeDataAvailable, final boolean isLast) throws IOException | |
| isAsyncEnabled | back to summary |
|---|---|
| public boolean isAsyncEnabled()
Deprecated will always return true
| |
| isClosed | back to summary |
|---|---|
public boolean isClosed()
| |
| isFinished | back to summary |
|---|---|
public boolean isFinished()
| |
| log | back to summary |
|---|---|
| private static void log(final String message, Object... params) | |
| mark | back to summary |
|---|---|
| public void mark(final int readAheadLimit) Supported with binary and character data. | |
| markSupported | back to summary |
|---|---|
| public boolean markSupported() Only supported with binary data.
| |
| notifyAvailable | back to summary |
|---|---|
| public void notifyAvailable(final ReadHandler handler) Installs a
| |
| notifyAvailable | back to summary |
|---|---|
| public void notifyAvailable(final ReadHandler handler, final int size) Installs a
| |
| processingChars | back to summary |
|---|---|
| public void processingChars()
This method should be called if the InputBuffer is being used in conjunction with a | |
| processTrailers | back to summary |
|---|---|
| private void processTrailers() | |
| read | back to summary |
|---|---|
| public int read(final byte[] b, final int off, final int len) throws IOException | |
| read | back to summary |
|---|---|
| public int read(final CharBuffer target) throws IOException | |
| read | back to summary |
|---|---|
| public int read(final char[] cbuf, final int off, final int len) throws IOException | |
| readBuffer | back to summary |
|---|---|
public Buffer readBuffer()
| |
| readBuffer | back to summary |
|---|---|
public Buffer readBuffer(final int size)
| |
| readByte | back to summary |
|---|---|
| public int readByte() throws IOException This method always blocks.
| |
| readChar | back to summary |
|---|---|
public int readChar() throws IOException
| |
| ready | back to summary |
|---|---|
public boolean ready()
| |
| readyData | back to summary |
|---|---|
| public int readyData() Depending on the InputBuffer mode, method will return either number of available bytes or characters ready to be read without blocking.
| |
| recycle | back to summary |
|---|---|
| public void recycle()
Recycle this | |
| replayPayload | back to summary |
|---|---|
| public void replayPayload(final Buffer buffer) | |
| reset | back to summary |
|---|---|
| public void reset() throws IOException Only supported with binary data.
| |
| setAsyncEnabled | back to summary |
|---|---|
| public void setAsyncEnabled(boolean asyncEnabled)
Deprecated
Sets the asynchronous processing state of this
| |
| setDefaultEncoding | back to summary |
|---|---|
| public void setDefaultEncoding(final String encoding) Set the default character encoding for this InputBuffer, which would be applied if no encoding was
explicitly set on HTTP
| |
| shouldNotifyNow | back to summary |
|---|---|
private static boolean shouldNotifyNow(final int size, final int available)
| |
| skip | back to summary |
|---|---|
| public long skip(final long n, final boolean block) throws IOException
Deprecated pls. use Skips the specified number of bytes/characters.
| |
| skip | back to summary |
|---|---|
| public long skip(final long n) throws IOException Skips the specified number of bytes/characters. | |
| terminate | back to summary |
|---|---|
| public void terminate()
Invoke
| |
| toCompositeInputContentBuffer | back to summary |
|---|---|
| private CompositeBuffer toCompositeInputContentBuffer() | |
| updateInputContentBuffer | back to summary |
|---|---|
| protected void updateInputContentBuffer(final Buffer buffer) throws IOException | |