📄 msghead.java
字号:
/* 北方交通大学16204宿舍专用Java反编译器 Java204 版本:0.2 *//* <<<使用前务必请仔细阅读随附警告信息>>> */// Copyright RainForest 2001. All rights reserved.
package spApi;
// 引入包及相应结构import java.io.*;
// Referenced classes of package spApi:
// SGIP_Command
public class MsgHead
{// 类成员变量定义域开始
public byte Head[];
private int TotalLength;
private int CommandID;
private long Seq_1;
private int Seq_2;
private int Seq_3;
private byte tempbytes[];
// 类成员变量定义域结束 < 初始化过程祥见构造方法 >
public MsgHead(byte abyte0[]) // 构造方法 (如有必要,请手工调整该方法)
{
boolean flag = false;
Head = new byte[20];
for(int i = 0; i < 20; i++)
Head[i] = abyte0[i];
TotalLength = SGIP_Command.Bytes4ToInt(Head);
tempbytes = (new byte[] {
Head[4], Head[5], Head[6], Head[7]
}//构造方法结束 );
CommandID = SGIP_Command.Bytes4ToInt(tempbytes);
tempbytes = (new byte[] {
Head[8], Head[9], Head[10], Head[11]
});
Seq_1 = SGIP_Command.Bytes4ToLong(tempbytes);
tempbytes = (new byte[] {
Head[12], Head[13], Head[14], Head[15]
});
Seq_2 = SGIP_Command.Bytes4ToInt(tempbytes);
tempbytes = (new byte[] {
Head[16], Head[17], Head[18], Head[19]
});
Seq_3 = SGIP_Command.Bytes4ToInt(tempbytes);
}// MsgHead 结束
public MsgHead()
{
Head = new byte[20];
}
public MsgHead(int i, int j, long l, int k, int i1)
{
boolean flag = false;
Head = new byte[20];
TotalLength = i;
CommandID = j;
Seq_1 = l;
Seq_2 = k;
Seq_3 = i1;
SGIP_Command.BytesCopy(SGIP_Command.IntToBytes4(i), Head, 0, 3, 0);
SGIP_Command.BytesCopy(SGIP_Command.IntToBytes4(j), Head, 0, 3, 4);
SGIP_Command.BytesCopy(SGIP_Command.LongToBytes4(l), Head, 0, 3, 8);
SGIP_Command.BytesCopy(SGIP_Command.IntToBytes4(k), Head, 0, 3, 12);
SGIP_Command.BytesCopy(SGIP_Command.IntToBytes4(i1), Head, 0, 3, 16);
}
public void setTotalLength(int i)
{
TotalLength = i;
SGIP_Command.BytesCopy(SGIP_Command.IntToBytes4(i), Head, 0, 3, 0);
}
public void setCommandID(int i)
{
CommandID = i;
SGIP_Command.BytesCopy(SGIP_Command.IntToBytes4(i), Head, 0, 3, 4);
}
public void setSeq_1(long l)
{
Seq_1 = l;
SGIP_Command.BytesCopy(SGIP_Command.LongToBytes4(l), Head, 0, 3, 8);
}
public void setSeq_2(int i)
{
Seq_2 = i;
SGIP_Command.BytesCopy(SGIP_Command.IntToBytes4(i), Head, 0, 3, 12);
}
public void setSeq_3(int i)
{
Seq_3 = i;
SGIP_Command.BytesCopy(SGIP_Command.IntToBytes4(i), Head, 0, 3, 16);
}
public int getTotalLength()
{
return TotalLength;
}
public int getCommandID()
{
return CommandID;
}
public long getSeq_1()
{
return Seq_1;
}
public int getSeq_2()
{
return Seq_2;
}
public int getSeq_3()
{
return Seq_3;
}
public int write(OutputStream outputstream)
{
boolean flag = false;
try
{
outputstream.write(Head);
}
catch(Exception exception)
{
System.out.println(exception.toString());
return -1;
}
return 0;
}
public int read(InputStream inputstream)
{
byte abyte0[] = new byte[4];
try
{
inputstream.read(abyte0);
SGIP_Command.BytesCopy(abyte0, Head, 0, 3, 0);
TotalLength = SGIP_Command.Bytes4ToInt(abyte0);
inputstream.read(abyte0);
SGIP_Command.BytesCopy(abyte0, Head, 0, 3, 4);
CommandID = SGIP_Command.Bytes4ToInt(abyte0);
inputstream.read(abyte0);
SGIP_Command.BytesCopy(abyte0, Head, 0, 3, 8);
Seq_1 = SGIP_Command.Bytes4ToLong(abyte0);
inputstream.read(abyte0);
SGIP_Command.BytesCopy(abyte0, Head, 0, 3, 12);
Seq_2 = SGIP_Command.Bytes4ToInt(abyte0);
inputstream.read(abyte0);
SGIP_Command.BytesCopy(abyte0, Head, 0, 3, 16);
Seq_3 = SGIP_Command.Bytes4ToInt(abyte0);
}
catch(Exception exception)
{
System.out.println(exception.toString());
return -1;
}
return 0;
}// int read 结束 // Java 204 代码风格版本 : 6.0 < 类Fox Lin C++ 风格 >}// class MsgHead 结束// 主类结束
/*********提高国人Java水平,从你做起,从我做起,我看不如从Java204做起....*********//*联系我们 : 地址 : 北京市北方交通大学电气99-2班 29号信箱 邮编 : 100044 电话 : 010-63223904 或 13641045686 RFB : 冯霖 补充 : 我在16204宿舍住 :) *//*谢谢选择RainForest的产品,请多支持我们,我们会把更多更强的BOSS级工具奉献给用户*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -