Extracted some important comments in the example code to a new section

This commit is contained in:
Trustin Lee 2008-09-03 13:04:02 +00:00
parent f86a7d224b
commit a79f3ff159

View File

@ -124,16 +124,20 @@ import org.jboss.netty.channel.SimpleChannelHandler;
* ChannelBuffer frame = buf.readBytes(length);
*
* // 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>;
* }
* }
* </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 Trustin Lee (tlee@redhat.com)
*