public class HttpResponseEncoder extends HttpObjectEncoder<HttpResponse>
ChannelHandler.Sharable
Constructor and Description |
---|
HttpResponseEncoder() |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptOutboundMessage(java.lang.Object msg)
如果应该处理给定的消息,则返回
true 。
|
protected void |
encodeInitialLine(ByteBuf buf, HttpResponse response) |
protected boolean |
isContentAlwaysEmpty(HttpResponse msg)
确定消息是否包含内容。
|
protected void |
sanitizeHeadersBeforeEncode(HttpResponse msg, boolean isAlwaysEmpty)
允许在编码这些消息之前清理消息的标题。
|
encode, encodeAscii, encodeHeaders
write
bind, close, connect, deregister, disconnect, flush, read
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exceptionCaught, handlerAdded, handlerRemoved
public boolean acceptOutboundMessage(java.lang.Object msg) throws java.lang.Exception
MessageToMessageEncoder
true
。
如果false
它将被传递到ChannelOutboundHandler
中的下一个ChannelOutboundHandler
。
acceptOutboundMessage
在课堂上
HttpObjectEncoder<HttpResponse>
java.lang.Exception
protected void encodeInitialLine(ByteBuf buf, HttpResponse response) throws java.lang.Exception
encodeInitialLine
在课堂上
HttpObjectEncoder<HttpResponse>
java.lang.Exception
protected void sanitizeHeadersBeforeEncode(HttpResponse msg, boolean isAlwaysEmpty)
HttpObjectEncoder
protected boolean isContentAlwaysEmpty(HttpResponse msg)
HttpObjectEncoder
isContentAlwaysEmpty
在课堂上
HttpObjectEncoder<HttpResponse>
msg
- 要测试的消息
true
to signal the message has no content
Copyright © 2008–2018 The Netty Project. All rights reserved.