package com.hmsoft.remote.rmi.codec;

import java.io.IOException;
import com.hmsoft.remote.rmi.buffer.ChannelBuffer;
import com.hmsoft.remote.rmi.transport.NettyChannel;

/**
 * 
 * @author zq
 *
 */
public interface Codec {

	void encode(NettyChannel channel, ChannelBuffer buffer, Object msg) throws IOException;
	
	Object decode(NettyChannel channel, ChannelBuffer buffer) throws IOException;
	
    enum DecodeResult {
        NEED_MORE_INPUT, SKIP_SOME_INPUT
    }
}
