Extracted some important comments in the example code to a new section
This commit is contained in:
parent
f86a7d224b
commit
a79f3ff159
@ -124,16 +124,20 @@ import org.jboss.netty.channel.SimpleChannelHandler;
|
|||||||
* ChannelBuffer frame = buf.readBytes(length);
|
* ChannelBuffer frame = buf.readBytes(length);
|
||||||
*
|
*
|
||||||
* // Successfully decoded a frame. Return the decoded frame.
|
* // Successfully decoded a frame. Return the decoded frame.
|
||||||
* // Please note that you can return a different type than
|
|
||||||
* // {@link ChannelBuffer} although this example returns a {@link ChannelBuffer}.
|
|
||||||
* // For example, you could return a <a href="http://en.wikipedia.org/wiki/POJO">POJO</a> here so that the next
|
|
||||||
* // {@link ChannelUpstreamHandler} receives a {@link MessageEvent} which contains
|
|
||||||
* // a POJO rather than a {@link ChannelBuffer}.
|
|
||||||
* return <strong>frame</strong>;
|
* return <strong>frame</strong>;
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
* <h3>Returning a POJO rather than a {@link ChannelBuffer}</h3>
|
||||||
|
* <p>
|
||||||
|
* Please note that you can return an object of a different type than
|
||||||
|
* {@link ChannelBuffer} in your {@code decode()} and {@code decodeLast()}
|
||||||
|
* implementation. For example, you could return a
|
||||||
|
* <a href="http://en.wikipedia.org/wiki/POJO">POJO</a> so that the next
|
||||||
|
* {@link ChannelUpstreamHandler} receives a {@link MessageEvent} which
|
||||||
|
* contains a POJO rather than a {@link ChannelBuffer}.
|
||||||
|
*
|
||||||
* @author The Netty Project (netty-dev@lists.jboss.org)
|
* @author The Netty Project (netty-dev@lists.jboss.org)
|
||||||
* @author Trustin Lee (tlee@redhat.com)
|
* @author Trustin Lee (tlee@redhat.com)
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user