12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- package at.acdp.urweb.sclient.data;
- import java.io.DataInputStream;
- import java.io.IOException;
- public class VersionMessage {
- public int msgType;
- public long tstamp;
- public int source;
- public int robotMsgType;
- public String name;
- public int majorVersion;
- public int minorVersion;
- public int bugFixVersion;
- public int buildNumber;
- public String buildDate;
- public void readVersionMessage(DataInputStream in) throws IOException {
- int msgSize = in.readInt();
- msgType = in.readByte() & 0xff;
- tstamp = in.readLong();
- source = in.readByte();
- robotMsgType = in.readByte();
- int projectNameSize = in.readByte() & 0xff;
- byte[] nameBytes = new byte[projectNameSize];
- in.read(nameBytes);
- name = new String(nameBytes);
- majorVersion = in.readByte() & 0xff;
- minorVersion = in.readByte() & 0xff;
- bugFixVersion = in.readInt();
- buildNumber = in.readInt();
- byte[] buildDateBytes = new byte[msgSize - (16 + projectNameSize + 10)];
- in.read(buildDateBytes);
- buildDate = new String(buildDateBytes);
- }
- @Override
- public String toString() {
- return "VersionMessage{" +
- "msgType=" + msgType +
- ", tstamp=" + tstamp +
- ", source=" + source +
- ", robotMsgType=" + robotMsgType +
- ", name='" + name + '\'' +
- ", majorVersion=" + majorVersion +
- ", minorVersion=" + minorVersion +
- ", bugFixVersion=" + bugFixVersion +
- ", buildNumber=" + buildNumber +
- ", buildDate='" + buildDate + '\'' +
- '}';
- }
- }
|