com.mooapi.common.command.client
Class ClientCommandCodec

java.lang.Object
  extended by com.mooapi.common.command.client.ClientCommandCodec

public class ClientCommandCodec
extends java.lang.Object

Utilities for encoding/decoding commands.

Author:
Steve Taylor

Constructor Summary
ClientCommandCodec()
           
 
Method Summary
 AbstractClientCommand decode(org.apache.mina.common.ByteBuffer buffer)
          Parse the specified byte buffer, returning the encoded client command it contains.
 MessageCodec getMessageCodec()
           
 void setMessageCodec(MessageCodec codec)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientCommandCodec

public ClientCommandCodec()
Method Detail

getMessageCodec

public MessageCodec getMessageCodec()

setMessageCodec

public void setMessageCodec(MessageCodec codec)

decode

public AbstractClientCommand decode(org.apache.mina.common.ByteBuffer buffer)
Parse the specified byte buffer, returning the encoded client command it contains.

Parameters:
buffer - A buffer.
Returns:
The client command.
Throws:
java.nio.BufferUnderflowException - if there are insufficient bytes to decode.
java.lang.IllegalArgumentException - if the buffer contains bytes that don't represent a client command.


Copyright © 2009. All Rights Reserved.