📄 setzcfg_library.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 SetZCFG_Library{ private int m_ZCFG_Id; private int m_ZcfgType_Id; private long m_CreateTime; private String m_FW_Number; private String m_FW_FWJG; private String m_FW_Key; private long m_FW_Date; private String m_FW_Title; private String m_FW_Type; private int m_IsNew; private int m_Validity; private String m_FW_FileName; private int m_IsAutoLK; private int m_LKInterval; private String m_FW_Describe; // Image can't auto deal : Image filed FW_Content nIndex = 16 private long m_LKDate; private String m_CreateName; private long m_ModifyTime; public SetZCFG_Library() { } public SetZCFG_Library(int ZCFG_Id,int ZcfgType_Id,long CreateTime,String FW_Number,String FW_FWJG,String FW_Key,long FW_Date,String FW_Title,String FW_Type,int IsNew,int Validity,String FW_FileName,int IsAutoLK,int LKInterval,String FW_Describe,long LKDate,String CreateName,long ModifyTime) { m_ZCFG_Id = ZCFG_Id; m_ZcfgType_Id = ZcfgType_Id; m_CreateTime = CreateTime; m_FW_Number = FW_Number; m_FW_FWJG = FW_FWJG; m_FW_Key = FW_Key; m_FW_Date = FW_Date; m_FW_Title = FW_Title; m_FW_Type = FW_Type; m_IsNew = IsNew; m_Validity = Validity; m_FW_FileName = FW_FileName; m_IsAutoLK = IsAutoLK; m_LKInterval = LKInterval; m_FW_Describe = FW_Describe; m_LKDate = LKDate; m_CreateName = CreateName; m_ModifyTime = ModifyTime; } public int getZCFG_Id() { return m_ZCFG_Id; } public void setZCFG_Id( int ZCFG_Id ) { m_ZCFG_Id = ZCFG_Id; } public int getZcfgType_Id() { return m_ZcfgType_Id; } public void setZcfgType_Id( int ZcfgType_Id ) { m_ZcfgType_Id = ZcfgType_Id; } public long getCreateTime() { return m_CreateTime; } public void setCreateTime( long CreateTime ) { m_CreateTime = CreateTime; } public String getFW_Number() { return m_FW_Number; } public void setFW_Number( String FW_Number ) { if( FW_Number == null ) FW_Number= "default"; m_FW_Number = FW_Number; } public String getFW_FWJG() { return m_FW_FWJG; } public void setFW_FWJG( String FW_FWJG ) { if( FW_FWJG == null ) FW_FWJG= "default"; m_FW_FWJG = FW_FWJG; } public String getFW_Key() { return m_FW_Key; } public void setFW_Key( String FW_Key ) { if( FW_Key == null ) FW_Key= "default"; m_FW_Key = FW_Key; } public long getFW_Date() { return m_FW_Date; } public void setFW_Date( long FW_Date ) { m_FW_Date = FW_Date; } public String getFW_Title() { return m_FW_Title; } public void setFW_Title( String FW_Title ) { if( FW_Title == null ) FW_Title= "default"; m_FW_Title = FW_Title; } public String getFW_Type() { return m_FW_Type; } public void setFW_Type( String FW_Type ) { if( FW_Type == null ) FW_Type= "default"; m_FW_Type = FW_Type; } public int getIsNew() { return m_IsNew; } public void setIsNew( int IsNew ) { m_IsNew = IsNew; } public int getValidity() { return m_Validity; } public void setValidity( int Validity ) { m_Validity = Validity; } public String getFW_FileName() { return m_FW_FileName; } public void setFW_FileName( String FW_FileName ) { if( FW_FileName == null ) FW_FileName= "default"; m_FW_FileName = FW_FileName; } public int getIsAutoLK() { return m_IsAutoLK; } public void setIsAutoLK( int IsAutoLK ) { m_IsAutoLK = IsAutoLK; } public int getLKInterval() { return m_LKInterval; } public void setLKInterval( int LKInterval ) { m_LKInterval = LKInterval; } public String getFW_Describe() { return m_FW_Describe; } public void setFW_Describe( String FW_Describe ) { if( FW_Describe == null ) FW_Describe= "default"; m_FW_Describe = FW_Describe; } public long getLKDate() { return m_LKDate; } public void setLKDate( long LKDate ) { m_LKDate = LKDate; } public String getCreateName() { return m_CreateName; } public void setCreateName( String CreateName ) { if( CreateName == null ) CreateName= "default"; m_CreateName = CreateName; } public long getModifyTime() { return m_ModifyTime; } public void setModifyTime( long ModifyTime ) { m_ModifyTime = ModifyTime; } //序列化 public byte[] serialize() throws IOException { ByteArrayOutputStream bout = new ByteArrayOutputStream(); DataOutputStream dout = new DataOutputStream(bout); dout.writeInt( m_ZCFG_Id ); dout.writeInt( m_ZcfgType_Id ); dout.writeLong( m_CreateTime ); dout.writeUTF( m_FW_Number ); dout.writeUTF( m_FW_FWJG ); dout.writeUTF( m_FW_Key ); dout.writeLong( m_FW_Date ); dout.writeUTF( m_FW_Title ); dout.writeUTF( m_FW_Type ); dout.writeInt( m_IsNew ); dout.writeInt( m_Validity ); dout.writeUTF( m_FW_FileName ); dout.writeInt( m_IsAutoLK ); dout.writeInt( m_LKInterval ); dout.writeUTF( m_FW_Describe ); dout.writeLong( m_LKDate ); dout.writeUTF( m_CreateName ); dout.writeLong( m_ModifyTime ); return bout.toByteArray(); } //反序列化 public void deserialize(byte[] data) throws IOException { ByteArrayInputStream bin = new ByteArrayInputStream(data); DataInputStream din = new DataInputStream(bin); m_ZCFG_Id = din.readInt(); m_ZcfgType_Id = din.readInt(); m_CreateTime = din.readLong(); m_FW_Number = din.readUTF(); m_FW_FWJG = din.readUTF(); m_FW_Key = din.readUTF(); m_FW_Date = din.readLong(); m_FW_Title = din.readUTF(); m_FW_Type = din.readUTF(); m_IsNew = din.readInt(); m_Validity = din.readInt(); m_FW_FileName = din.readUTF(); m_IsAutoLK = din.readInt(); m_LKInterval = din.readInt(); m_FW_Describe = din.readUTF(); m_LKDate = din.readLong(); m_CreateName = din.readUTF(); m_ModifyTime = din.readLong(); 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 + -