📄 settk_cl_ndzsd.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 Settk_cl_ndzsd{ private int m_cl_Id; private int m_tk_tkj_Id; private int m_tk_lx_id; private int m_tk_cl_id; private String m_tm_nd; private String m_tm_zsd; private String m_tm_tx; private int m_tm_num; public Settk_cl_ndzsd() { } public Settk_cl_ndzsd(int cl_Id,int tk_tkj_Id,int tk_lx_id,int tk_cl_id,String tm_nd,String tm_zsd,String tm_tx,int tm_num) { m_cl_Id = cl_Id; m_tk_tkj_Id = tk_tkj_Id; m_tk_lx_id = tk_lx_id; m_tk_cl_id = tk_cl_id; m_tm_nd = tm_nd; m_tm_zsd = tm_zsd; m_tm_tx = tm_tx; m_tm_num = tm_num; } public int getcl_Id() { return m_cl_Id; } public void setcl_Id( int cl_Id ) { m_cl_Id = cl_Id; } public int gettk_tkj_Id() { return m_tk_tkj_Id; } public void settk_tkj_Id( int tk_tkj_Id ) { m_tk_tkj_Id = tk_tkj_Id; } public int gettk_lx_id() { return m_tk_lx_id; } public void settk_lx_id( int tk_lx_id ) { m_tk_lx_id = tk_lx_id; } public int gettk_cl_id() { return m_tk_cl_id; } public void settk_cl_id( int tk_cl_id ) { m_tk_cl_id = tk_cl_id; } public String gettm_nd() { return m_tm_nd; } public void settm_nd( String tm_nd ) { if( tm_nd == null ) tm_nd= "default"; m_tm_nd = tm_nd; } public String gettm_zsd() { return m_tm_zsd; } public void settm_zsd( String tm_zsd ) { if( tm_zsd == null ) tm_zsd= "default"; m_tm_zsd = tm_zsd; } public String gettm_tx() { return m_tm_tx; } public void settm_tx( String tm_tx ) { if( tm_tx == null ) tm_tx= "default"; m_tm_tx = tm_tx; } public int gettm_num() { return m_tm_num; } public void settm_num( int tm_num ) { m_tm_num = tm_num; } //序列化 public byte[] serialize() throws IOException { ByteArrayOutputStream bout = new ByteArrayOutputStream(); DataOutputStream dout = new DataOutputStream(bout); dout.writeInt( m_cl_Id ); dout.writeInt( m_tk_tkj_Id ); dout.writeInt( m_tk_lx_id ); dout.writeInt( m_tk_cl_id ); dout.writeUTF( m_tm_nd ); dout.writeUTF( m_tm_zsd ); dout.writeUTF( m_tm_tx ); dout.writeInt( m_tm_num ); return bout.toByteArray(); } //反序列化 public void deserialize(byte[] data) throws IOException { ByteArrayInputStream bin = new ByteArrayInputStream(data); DataInputStream din = new DataInputStream(bin); m_cl_Id = din.readInt(); m_tk_tkj_Id = din.readInt(); m_tk_lx_id = din.readInt(); m_tk_cl_id = din.readInt(); m_tm_nd = din.readUTF(); m_tm_zsd = din.readUTF(); m_tm_tx = din.readUTF(); m_tm_num = 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 + -