Class HttpMessageEncoder
java.lang.Object
org.jboss.netty.handler.codec.oneone.OneToOneEncoder
org.jboss.netty.handler.codec.http.HttpMessageEncoder
- All Implemented Interfaces:
ChannelDownstreamHandler,ChannelHandler
- Direct Known Subclasses:
HttpRequestEncoder,HttpResponseEncoder,RtspMessageEncoder
Encodes an
HttpMessage or an HttpChunk into
a ChannelBuffer.
Extensibility
Please note that this encoder is designed to be extended to implement a protocol derived from HTTP, such as RTSP and ICAP. To implement the encoder of such a derived protocol, extend this class and implement all abstract methods properly.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
ChannelHandler.Sharable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Objectencode(ChannelHandlerContext ctx, Channel channel, Object msg) Transforms the specified message into another message and return the transformed message.protected static voidencodeAscii(String s, ChannelBuffer buf) protected abstract voidencodeInitialLine(ChannelBuffer buf, HttpMessage message) Methods inherited from class org.jboss.netty.handler.codec.oneone.OneToOneEncoder
doEncode, handleDownstream
-
Constructor Details
-
HttpMessageEncoder
protected HttpMessageEncoder()Creates a new instance.
-
-
Method Details
-
encode
Description copied from class:OneToOneEncoderTransforms the specified message into another message and return the transformed message. Note that you can not returnnull, unlike you can inOneToOneDecoder.decode(ChannelHandlerContext, Channel, Object); you must return something, at leastChannelBuffers.EMPTY_BUFFER.- Specified by:
encodein classOneToOneEncoder- Throws:
Exception
-
encodeAscii
-
encodeInitialLine
- Throws:
Exception
-