⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setnetoption.java

📁 一个手机上的考试系统的有服务器源码
💻 JAVA
字号:
/* * Author :  胡家宝 * Date   :  2006-6-30 10:54:52 */  package WebExam;  import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.util.*; public class SetNetOption{	private int m_AutoId;	private int m_Net_Id;	private int m_Clerk_Id;	private long m_NetEndTime;	private int m_NetOption;	public SetNetOption()	{	}	public SetNetOption(int AutoId,int Net_Id,int Clerk_Id,long NetEndTime,int NetOption)	{		m_AutoId = AutoId;		m_Net_Id = Net_Id;		m_Clerk_Id = Clerk_Id;		m_NetEndTime = NetEndTime;		m_NetOption = NetOption;	}	public int getAutoId()	{		return m_AutoId;	}	public void setAutoId( int AutoId  )	{		m_AutoId = AutoId;	}	public int getNet_Id()	{		return m_Net_Id;	}	public void setNet_Id( int Net_Id  )	{		m_Net_Id = Net_Id;	}	public int getClerk_Id()	{		return m_Clerk_Id;	}	public void setClerk_Id( int Clerk_Id  )	{		m_Clerk_Id = Clerk_Id;	}	public long getNetEndTime()	{		return m_NetEndTime;	}	public void setNetEndTime( long NetEndTime  )	{		m_NetEndTime = NetEndTime;	}	public int getNetOption()	{		return m_NetOption;	}	public void setNetOption( int NetOption  )	{		m_NetOption = NetOption;	}	//序列化	public byte[] serialize() throws IOException	{		ByteArrayOutputStream bout = new ByteArrayOutputStream();		DataOutputStream dout = new DataOutputStream(bout);		dout.writeInt( m_AutoId );		dout.writeInt( m_Net_Id );		dout.writeInt( m_Clerk_Id );		dout.writeLong( m_NetEndTime );		dout.writeInt( m_NetOption );		return bout.toByteArray();	}	//反序列化	public  void  deserialize(byte[] data) throws IOException	{		ByteArrayInputStream bin = new ByteArrayInputStream(data);		DataInputStream din = new DataInputStream(bin);		m_AutoId = din.readInt();		m_Net_Id = din.readInt();		m_Clerk_Id = din.readInt();		m_NetEndTime = din.readLong();		m_NetOption = din.readInt();		bin.close();		din.close();	}	public static boolean matches(byte[] data, String userName) throws IOException  	{ 		ByteArrayInputStream bais = new ByteArrayInputStream(data); 		DataInputStream dis = new DataInputStream(bais); 		try 		{ 			return (dis.readUTF()).equals(userName); 		} 		catch (IOException e) 		{ 			e.printStackTrace(); 			return false; 		} 	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -