ml.shifu.guagua.io
类 NettyBytableDecoder

java.lang.Object
  继承者 org.jboss.netty.channel.SimpleChannelUpstreamHandler
      继承者 org.jboss.netty.handler.codec.frame.FrameDecoder
          继承者 org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder
              继承者 ml.shifu.guagua.io.NettyBytableDecoder
所有已实现的接口:
org.jboss.netty.channel.ChannelHandler, org.jboss.netty.channel.ChannelUpstreamHandler, org.jboss.netty.channel.LifeCycleAwareChannelHandler

public class NettyBytableDecoder
extends org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder

A decoder to decode bytes array to Bytable object.


嵌套类摘要
 
从接口 org.jboss.netty.channel.ChannelHandler 继承的嵌套类/接口
org.jboss.netty.channel.ChannelHandler.Sharable
 
字段摘要
 
从类 org.jboss.netty.handler.codec.frame.FrameDecoder 继承的字段
cumulation, DEFAULT_MAX_COMPOSITEBUFFER_COMPONENTS
 
构造方法摘要
NettyBytableDecoder()
          Default constructor with max object size 64M.
NettyBytableDecoder(int maxObjectSize)
          Creates a new decoder with the specified maximum object size.
 
方法摘要
protected  Object decode(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.Channel channel, org.jboss.netty.buffer.ChannelBuffer buffer)
           
protected  org.jboss.netty.buffer.ChannelBuffer extractFrame(org.jboss.netty.buffer.ChannelBuffer buffer, int index, int length)
           
 
从类 org.jboss.netty.handler.codec.frame.FrameDecoder 继承的方法
actualReadableBytes, afterAdd, afterRemove, appendToCumulation, beforeAdd, beforeRemove, channelClosed, channelDisconnected, cleanup, decodeLast, exceptionCaught, getMaxCumulationBufferCapacity, getMaxCumulationBufferComponents, internalBuffer, isUnfold, messageReceived, newCumulationBuffer, replace, setMaxCumulationBufferCapacity, setMaxCumulationBufferComponents, setUnfold, unfoldAndFireMessageReceived, updateCumulation
 
从类 org.jboss.netty.channel.SimpleChannelUpstreamHandler 继承的方法
channelBound, channelConnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, writeComplete
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

NettyBytableDecoder

public NettyBytableDecoder()
Default constructor with max object size 64M.


NettyBytableDecoder

public NettyBytableDecoder(int maxObjectSize)
Creates a new decoder with the specified maximum object size.

参数:
maxObjectSize - the maximum byte length of the serialized object. if the length of the received object is greater than this value, StreamCorruptedException will be raised.
方法详细信息

decode

protected Object decode(org.jboss.netty.channel.ChannelHandlerContext ctx,
                        org.jboss.netty.channel.Channel channel,
                        org.jboss.netty.buffer.ChannelBuffer buffer)
                 throws Exception
覆盖:
org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder 中的 decode
抛出:
Exception

extractFrame

protected org.jboss.netty.buffer.ChannelBuffer extractFrame(org.jboss.netty.buffer.ChannelBuffer buffer,
                                                            int index,
                                                            int length)
覆盖:
org.jboss.netty.handler.codec.frame.FrameDecoder 中的 extractFrame


Copyright © 2015. All Rights Reserved.