public abstract class HttpObjectEncoder<H extends HttpMessage> extends io.netty.handler.codec.MessageToMessageEncoder<Object>
HttpMessage or an HttpContent into
a ByteBuf.
| Constructor and Description |
|---|
HttpObjectEncoder() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptOutboundMessage(Object msg) |
protected void |
encode(io.netty.channel.ChannelHandlerContext ctx,
Object msg,
List<Object> out) |
protected static void |
encodeAscii(String s,
io.netty.buffer.ByteBuf buf)
Deprecated.
|
protected void |
encodeHeaders(HttpHeaders headers,
io.netty.buffer.ByteBuf buf)
Encode the
HttpHeaders into a ByteBuf. |
protected abstract void |
encodeInitialLine(io.netty.buffer.ByteBuf buf,
H message) |
protected boolean |
isContentAlwaysEmpty(H msg)
Determine whether a message has a content or not.
|
protected void |
sanitizeHeadersBeforeEncode(H msg,
boolean isAlwaysEmpty)
Allows to sanitize headers of the message before encoding these.
|
void |
write(io.netty.channel.ChannelHandlerContext ctx,
Object msg,
io.netty.channel.ChannelPromise promise) |
bind, close, connect, deregister, disconnect, flush, readensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharablepublic void write(io.netty.channel.ChannelHandlerContext ctx,
Object msg,
io.netty.channel.ChannelPromise promise)
throws Exception
protected void encode(io.netty.channel.ChannelHandlerContext ctx,
Object msg,
List<Object> out)
throws Exception
protected void encodeHeaders(HttpHeaders headers, io.netty.buffer.ByteBuf buf)
HttpHeaders into a ByteBuf.protected void sanitizeHeadersBeforeEncode(H msg, boolean isAlwaysEmpty)
protected boolean isContentAlwaysEmpty(H msg)
msg - the message to testtrue to signal the message has no content@Deprecated protected static void encodeAscii(String s, io.netty.buffer.ByteBuf buf)
Copyright © 2008–2023 The Netty Project. All rights reserved.