diff --git a/src/main/java/org/jboss/netty/handler/codec/frame/LengthFieldBasedFrameDecoder.java b/src/main/java/org/jboss/netty/handler/codec/frame/LengthFieldBasedFrameDecoder.java index 2238384c2b..b87f9d0f17 100644 --- a/src/main/java/org/jboss/netty/handler/codec/frame/LengthFieldBasedFrameDecoder.java +++ b/src/main/java/org/jboss/netty/handler/codec/frame/LengthFieldBasedFrameDecoder.java @@ -38,26 +38,12 @@ import org.jboss.netty.channel.ChannelHandlerContext; * proprietary client-server protocols. Here are some example that will give * you the basic idea on which option does what. * - *
- * lengthFieldOffset = 0 - * lengthFieldLength = 4 - * lengthAdjustment = 0 - * initialBytesToStrip = 4 - * - * BEFORE DECODE (16 bytes) AFTER DECODE (12 bytes) - * +--------------+----------------+ +----------------+ - * | Length Field | Actual Content |----->| Actual Content | - * | 0x0000000C | "HELLO, WORLD" | | "HELLO, WORLD" | - * +--------------+----------------+ +----------------+ - *- * *
* lengthFieldOffset = 0 * lengthFieldLength = 2 - * lengthAdjustment = 0 - * initialBytesToStrip = 0 + * lengthAdjustment = 0 (default) + * initialBytesToStrip = 0 (default) * * BEFORE DECODE (14 bytes) AFTER DECODE (14 bytes) * +--------+----------------+ +--------+----------------+ @@ -66,6 +52,20 @@ import org.jboss.netty.channel.ChannelHandlerContext; * +--------+----------------+ +--------+----------------+ ** + *
+ * lengthFieldOffset = 0 + * lengthFieldLength = 2 + * lengthAdjustment = 0 + * initialBytesToStrip = 2 + * + * BEFORE DECODE (14 bytes) AFTER DECODE (12 bytes) + * +--------+----------------+ +----------------+ + * | Length | Actual Content |----->| Actual Content | + * | 0x000C | "HELLO, WORLD" | | "HELLO, WORLD" | + * +--------+----------------+ +----------------+ + *+ * *
* lengthFieldOffset = 2 (= 5 - 3)