org.littleshoot.util.mina
Class FixedLengthDecodingState

java.lang.Object
  extended by org.littleshoot.util.mina.FixedLengthDecodingState
All Implemented Interfaces:
DecodingState

public abstract class FixedLengthDecodingState
extends Object
implements DecodingState

A DecodingState which consumes all received bytes until a configured number of read bytes has been reached. Modified slightly for LittleShoot -- code from the great AsyncWeb project.

Version:
$Rev: 237 $, $Date: 2007-03-02 03:18:55 -0500 (Fri, 02 Mar 2007) $
Author:
irvingd, trustin

Field Summary
protected  int m_length
           
 
Constructor Summary
FixedLengthDecodingState(int length)
          Constructs with a known decode length.
 
Method Summary
 DecodingState decode(org.littleshoot.mina.common.ByteBuffer in, org.littleshoot.mina.filter.codec.ProtocolDecoderOutput out)
          Decodes the input for this state.
protected abstract  DecodingState finishDecode(org.littleshoot.mina.common.ByteBuffer readData, org.littleshoot.mina.filter.codec.ProtocolDecoderOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_length

protected final int m_length
Constructor Detail

FixedLengthDecodingState

public FixedLengthDecodingState(int length)
Constructs with a known decode length.

Parameters:
length - The decode length
Method Detail

decode

public DecodingState decode(org.littleshoot.mina.common.ByteBuffer in,
                            org.littleshoot.mina.filter.codec.ProtocolDecoderOutput out)
                     throws Exception
Description copied from interface: DecodingState
Decodes the input for this state.

Specified by:
decode in interface DecodingState
Parameters:
in - The read data.
out - The output to write to.
Returns:
The next decoding state.
Throws:
Exception - If any error occurs.

finishDecode

protected abstract DecodingState finishDecode(org.littleshoot.mina.common.ByteBuffer readData,
                                              org.littleshoot.mina.filter.codec.ProtocolDecoderOutput out)
                                       throws Exception
Throws:
Exception


Copyright © 2013 LittleShoot. All Rights Reserved.