ReadInt64() public method

Reads a 64-bit signed integer from the stream, using the bit converter for this reader. 8 bytes are read.
public ReadInt64 ( ) : long
return long
コード例 #1
0
ファイル: TimeUpdate.cs プロジェクト: mctraveler/MineSharp
 protected override void Parse(EndianBinaryReader r)
 {
     Time = r.ReadInt64();
     TimeOfDay = r.ReadInt64();
 }
コード例 #2
0
        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));
        }
コード例 #3
0
ファイル: CoordInt.cs プロジェクト: mctraveler/MineSharp
 public static CoordInt Read(EndianBinaryReader r)
 {
     return Decode(r.ReadInt64());
 }
コード例 #4
0
 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);
 }