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

📄 setbaseupdatefile.java

📁 一个手机上的考试系统的有服务器源码
💻 JAVA
字号:
/* * Author :  胡家宝 * Date   :  2006-6-30 10:54:53 */  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 SetBaseUpdateFile{	private int m_UpdateFileID;	private int m_UpdateID;	private String m_FileName;	// Image can't auto deal :  Image filed FileContent nIndex = 4	private int m_Other;	public SetBaseUpdateFile()	{	}	public SetBaseUpdateFile(int UpdateFileID,int UpdateID,String FileName,int Other)	{		m_UpdateFileID = UpdateFileID;		m_UpdateID = UpdateID;		m_FileName = FileName;		m_Other = Other;	}	public int getUpdateFileID()	{		return m_UpdateFileID;	}	public void setUpdateFileID( int UpdateFileID  )	{		m_UpdateFileID = UpdateFileID;	}	public int getUpdateID()	{		return m_UpdateID;	}	public void setUpdateID( int UpdateID  )	{		m_UpdateID = UpdateID;	}	public String getFileName()	{		return m_FileName;	}	public void setFileName( String FileName  )	{	if( FileName == null )			FileName= "default";		m_FileName = FileName;	}	public int getOther()	{		return m_Other;	}	public void setOther( int Other  )	{		m_Other = Other;	}	//序列化	public byte[] serialize() throws IOException	{		ByteArrayOutputStream bout = new ByteArrayOutputStream();		DataOutputStream dout = new DataOutputStream(bout);		dout.writeInt( m_UpdateFileID );		dout.writeInt( m_UpdateID );		dout.writeUTF( m_FileName );		dout.writeInt( m_Other );		return bout.toByteArray();	}	//反序列化	public  void  deserialize(byte[] data) throws IOException	{		ByteArrayInputStream bin = new ByteArrayInputStream(data);		DataInputStream din = new DataInputStream(bin);		m_UpdateFileID = din.readInt();		m_UpdateID = din.readInt();		m_FileName = din.readUTF();		m_Other = 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 + -