📄 setclerk_group.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 SetClerk_Group{ private int m_Group_Id; private String m_Group_Name; private String m_Group_Describe; public SetClerk_Group() { } public SetClerk_Group(int Group_Id,String Group_Name,String Group_Describe) { m_Group_Id = Group_Id; m_Group_Name = Group_Name; m_Group_Describe = Group_Describe; } public int getGroup_Id() { return m_Group_Id; } public void setGroup_Id( int Group_Id ) { m_Group_Id = Group_Id; } public String getGroup_Name() { return m_Group_Name; } public void setGroup_Name( String Group_Name ) { if( Group_Name == null ) Group_Name= "default"; m_Group_Name = Group_Name; } public String getGroup_Describe() { return m_Group_Describe; } public void setGroup_Describe( String Group_Describe ) { if( Group_Describe == null ) Group_Describe= "default"; m_Group_Describe = Group_Describe; } //序列化 public byte[] serialize() throws IOException { ByteArrayOutputStream bout = new ByteArrayOutputStream(); DataOutputStream dout = new DataOutputStream(bout); dout.writeInt( m_Group_Id ); dout.writeUTF( m_Group_Name ); dout.writeUTF( m_Group_Describe ); return bout.toByteArray(); } //反序列化 public void deserialize(byte[] data) throws IOException { ByteArrayInputStream bin = new ByteArrayInputStream(data); DataInputStream din = new DataInputStream(bin); m_Group_Id = din.readInt(); m_Group_Name = din.readUTF(); m_Group_Describe = din.readUTF(); 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 + -