public static Version64 Parse(byte[] vb) { Version64 v = new Version64(); v.Major = BitConverter.ToUInt16(vb, 0); v.Minor = BitConverter.ToUInt16(vb, 2); v.Build = BitConverter.ToUInt16(vb, 4); v.Revision = BitConverter.ToUInt16(vb, 6); return(v); }
public static Version64 Parse(string version) { Version64 v = new Version64(); string[] s = version.Split('.'); v.Major = ushort.Parse(s[0]); v.Minor = ushort.Parse(s[1]); v.Build = ushort.Parse(s[2]); v.Revision = ushort.Parse(s[3]); return(v); }
public ReplayHeader(byte[] data) { int pos = 0; _length = (ushort)data.Length; ClientVersion = Version64.Parse(BitConverter.ToInt64(data, 0)); // 8 bytes ServerVersion = Version24.Parse(BinaryUtil.Extract(data, 8, 3)); // 3 bytes byte blen = data[11]; ObserverKey = new RawEntry8(BinaryUtil.Extract(data, 12, (int)blen)); // 1+blen bytes pos = 12 + blen; if (data.Length > pos) { ushort len = BitConverter.ToUInt16(data, pos); pos += 2; Signature = new RawEntry16(BinaryUtil.Extract(data, pos, (int)len)); pos += len; len = BitConverter.ToUInt16(data, pos); pos += 2; Certificate = new RawEntry16(BinaryUtil.Extract(data, pos, (int)len)); pos += len; } }