protected override void Parse(EndianBinaryReader r) { Time = r.ReadInt64(); TimeOfDay = r.ReadInt64(); }
internal BigRational ReadRational(EndianBinaryReader reader) { int sign = reader.ReadInt32(); long len = reader.ReadInt64(); byte[] num = new byte[len + 1]; // Extra byte for sign forcing positive value long l = ReadLongBuffer(num, len, reader); if (l != len) throw new InvalidOperationException(); // Non recoverable.. len = reader.ReadInt64(); byte[] den = new byte[len + 1]; // Extra byte on the end for positive sign l = ReadLongBuffer(den, len, reader); if (l != len) throw new InvalidOperationException(); // TODO Create a new ProtocolException() for when server sends unexpected data return new BigRational(new BigInteger(num) * sign, new BigInteger(den)); }
public static CoordInt Read(EndianBinaryReader r) { return Decode(r.ReadInt64()); }
protected override void Parse(EndianBinaryReader r) { EID = ReadVarInt(r); int count = r.ReadInt32(); //Console.Write("DEBx2C: " + EID + " "); for(int n = 0; n < count; n++) { var p = new Property(); p.Key = ReadString8(r); p.Val = r.ReadDouble(); int sub = ReadVarInt(r); p.List = new List<PropData>(); for (int s = 0; s < sub; s++) { var sd = new PropData(); sd.UUIDpart1 = r.ReadInt64(); sd.UUIDpart2 = r.ReadInt64(); sd.Amount = r.ReadDouble(); sd.Operation = r.ReadByte(); p.List.Add(sd); } Properties.Add(p); } //Debug.WriteLine(this); }