Top Description Fields Constructors Methods
io.netty.handler.codec.http

public Class HttpResponseEncoder

extends HttpObjectEncoder<HttpResponse>
Class Inheritance
Known Direct Subclasses
io.netty.handler.codec.http.HttpServerCodec.HttpServerResponseEncoder
Imports
io.netty.buffer.ByteBuf, .ByteBufUtil

Encodes an HttpResponse or an HttpContent into a ByteBuf.

Field Summary

Inherited from io.netty.handler.codec.http.HttpObjectEncoder:
CRLF_SHORT

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
acceptOutboundMessage(Object msg)

Overrides io.netty.handler.codec.http.HttpObjectEncoder.acceptOutboundMessage.

Returns true if the given message should be handled.
protected void
protected boolean
isContentAlwaysEmpty(HttpResponse
the message to test
msg
)

Overrides io.netty.handler.codec.http.HttpObjectEncoder.isContentAlwaysEmpty.

Determine whether a message has a content or not.
protected void
sanitizeHeadersBeforeEncode(HttpResponse msg, boolean isAlwaysEmpty)

Overrides io.netty.handler.codec.http.HttpObjectEncoder.sanitizeHeadersBeforeEncode.

Allows to sanitize headers of the message before encoding these.
Inherited from io.netty.handler.codec.http.HttpObjectEncoder:
encodeencodeAsciiencodeHeaderswrite

Constructor Detail

HttpResponseEncoderback to summary
public HttpResponseEncoder()

Method Detail

acceptOutboundMessageback to summary
public boolean acceptOutboundMessage(Object msg) throws Exception

Overrides io.netty.handler.codec.http.HttpObjectEncoder.acceptOutboundMessage.

Doc from io.netty.handler.codec.MessageToMessageEncoder.acceptOutboundMessage.

Returns true if the given message should be handled. If false it will be passed to the next ChannelOutboundHandler in the ChannelPipeline.

Annotations
@Override
encodeInitialLineback to summary
protected void encodeInitialLine(ByteBuf buf, HttpResponse response) throws Exception

Implements abstract io.netty.handler.codec.http.HttpObjectEncoder.encodeInitialLine.

Annotations
@Override
isContentAlwaysEmptyback to summary
protected boolean isContentAlwaysEmpty(HttpResponse msg)

Overrides io.netty.handler.codec.http.HttpObjectEncoder.isContentAlwaysEmpty.

Doc from io.netty.handler.codec.http.HttpObjectEncoder.isContentAlwaysEmpty.

Determine whether a message has a content or not. Some message may have headers indicating a content without having an actual content, e.g the response to an HEAD or CONNECT request.

Parameters
msg:HttpResponse

the message to test

Returns:boolean

true to signal the message has no content

Annotations
@Override
sanitizeHeadersBeforeEncodeback to summary
protected void sanitizeHeadersBeforeEncode(HttpResponse msg, boolean isAlwaysEmpty)

Overrides io.netty.handler.codec.http.HttpObjectEncoder.sanitizeHeadersBeforeEncode.

Doc from io.netty.handler.codec.http.HttpObjectEncoder.sanitizeHeadersBeforeEncode.

Allows to sanitize headers of the message before encoding these.

Annotations
@Override