org.littleshoot.util.mina.decode.binary
Class UnsignedShortDecodingState

java.lang.Object
  extended by org.littleshoot.util.mina.decode.binary.UnsignedShortDecodingState
All Implemented Interfaces:
DecodingState

public abstract class UnsignedShortDecodingState
extends Object
implements DecodingState

Decoding state for reading a single unsigned short.


Constructor Summary
UnsignedShortDecodingState()
           
 
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(int decoded, org.littleshoot.mina.filter.codec.ProtocolDecoderOutput out)
          Called on the subclass when the unsigned short has been successfully decoded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnsignedShortDecodingState

public UnsignedShortDecodingState()
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(int decoded,
                                              org.littleshoot.mina.filter.codec.ProtocolDecoderOutput out)
                                       throws Exception
Called on the subclass when the unsigned short has been successfully decoded.

Parameters:
decoded - The decoded unsigned short.
out - The decoder output.
Returns:
The next state.
Throws:
Exception - If any unexpected error occurs.


Copyright © 2013 LittleShoot. All Rights Reserved.