银行项目为后台socket通信写的程序
源代码在线查看: packetdecoder.java
/****************************************************************************
* Package : com.ecSolutions.ecAppServer.server
* File : PacketDecoder.java
* Create Date : 2007-7-20
* Author : Steven Chen
*
* Copyright(C) 2006 ecSolutions(shanghai) Co.,Limited.All Rights Reserved.
*
***************************************************************************/
package com.ecSolutions.ecAppServer.server;
/**
* Decode Packet to object.
*
* @author Steven Chen
* @version $Id: PacketDecoder.java,v 1.2 2007/07/26 04:10:42 stevenchen Exp $
*/
public interface PacketDecoder {
/**
* Decode packet to object. The content of the packet is readonly, and it's
* position will not be changed if the method return null.
*
* @param session
* session
* @param packet
* packet
* @return decoded object
* @throws Exception
* any exception
*/
Object decode(Session session, Packet packet) throws Exception;
}