org.neociclo.odetteftp.netty.codec
Class MoreDataBitDecoder

java.lang.Object
  extended by org.jboss.netty.channel.SimpleChannelUpstreamHandler
      extended by org.jboss.netty.handler.codec.frame.FrameDecoder
          extended by org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder
              extended by org.neociclo.odetteftp.netty.codec.MoreDataBitDecoder
All Implemented Interfaces:
org.jboss.netty.channel.ChannelHandler, org.jboss.netty.channel.ChannelUpstreamHandler

@ChannelHandler.Sharable
public class MoreDataBitDecoder
extends org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder

Version:
$Rev: 411 $ $Date: 2010-06-21 11:55:04 -0300 (Mon, 21 Jun 2010) $
Author:
Rafael Marins

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
org.jboss.netty.channel.ChannelHandler.Sharable
 
Constructor Summary
MoreDataBitDecoder()
          Create decoder instance based on LengthFieldBasedFrameDecoder.
 
Method Summary
 
Methods inherited from class org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder
decode, extractFrame
 
Methods inherited from class org.jboss.netty.handler.codec.frame.FrameDecoder
channelClosed, channelDisconnected, decodeLast, exceptionCaught, messageReceived
 
Methods inherited from class org.jboss.netty.channel.SimpleChannelUpstreamHandler
channelBound, channelConnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, writeComplete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MoreDataBitDecoder

public MoreDataBitDecoder()
Create decoder instance based on LengthFieldBasedFrameDecoder. Length field contains the buffer data size only. Use the following settings:
 lengthFieldOffset   = 0
 lengthFieldLength   = 2
 lengthAdjustment    = 0
 initialBytesToStrip = 2 (= the length of the Length field)

 BEFORE DECODE (14 bytes)         AFTER DECODE (12 bytes)
 +--------+----------------+      +----------------+
 | Length | Actual Content |----->| Actual Content |
 | 0x000C | "HELLO, WORLD" |      | "HELLO, WORLD" |
 +--------+----------------+      +----------------+
 



ACCORD