public abstract class AbstractContentDecoder extends Object implements ContentDecoder
ContentDecoder that serves as a base for all content
decoder implementations.| 限定符和类型 | 字段和说明 |
|---|---|
protected boolean |
completed |
| 构造器和说明 |
|---|
AbstractContentDecoder(ReadableByteChannel channel,
SessionInputBuffer buffer,
BasicHttpTransportMetrics metrics)
Creates an instance of this class.
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected SessionInputBuffer |
buffer() |
protected ReadableByteChannel |
channel() |
protected int |
fillBufferFromChannel()
Reads from the channel to the session buffer.
|
List<? extends Header> |
getTrailers()
Returns content trailers if available
|
boolean |
isCompleted()
Returns
true if the entity has been received in its
entirety. |
protected BasicHttpTransportMetrics |
metrics() |
protected int |
readFromChannel(ByteBuffer dst)
Reads from the channel to the destination.
|
protected int |
readFromChannel(ByteBuffer dst,
int limit)
Reads from the channel to the destination.
|
protected void |
setCompleted()
Sets the completed status of this decoder to true.
|
void |
setCompleted(boolean completed)
Sets the completed status of this decoder.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadpublic AbstractContentDecoder(ReadableByteChannel channel, SessionInputBuffer buffer, BasicHttpTransportMetrics metrics)
channel - the source channel.buffer - the session input buffer that can be used to store
session data for intermediate processing.metrics - Transport metrics of the underlying HTTP transport.protected ReadableByteChannel channel()
protected SessionInputBuffer buffer()
protected BasicHttpTransportMetrics metrics()
public boolean isCompleted()
ContentDecodertrue if the entity has been received in its
entirety.isCompleted 在接口中 ContentDecodertrue if all the content has been consumed,
false otherwise.public void setCompleted(boolean completed)
completed - the completed status of this decoder.protected void setCompleted()
protected int readFromChannel(ByteBuffer dst) throws IOException
dst - destination.IOExceptionprotected int fillBufferFromChannel()
throws IOException
IOExceptionprotected int readFromChannel(ByteBuffer dst, int limit) throws IOException
dst - destination.limit - max number of bytes to transfer.IOExceptionpublic List<? extends Header> getTrailers()
ContentDecodergetTrailers 在接口中 ContentDecoderCopyright © 2023. All rights reserved.