コード例 #1
0
        /// <summary>
        /// Reads a value from the packet
        /// </summary>
        /// <returns>value</returns>
        public long ReadLong()
        {
            long res = ByteManipulator.ReadInt64(Data, CurrentSeek);

            CurrentSeek += sizeof(long);
            return(res);
        }
コード例 #2
0
    public void TestListLongReadRedLight()
    {
        List <byte> arr = new List <byte>(sizeof(long));

        for (int i = 0; i < sizeof(long); i++)
        {
            arr.Add(0);
        }
        ByteManipulator.Write(arr, 0, (long)-25);
        Assert.That(ByteManipulator.ReadInt64(arr, 0), Is.Not.EqualTo(9));
    }
コード例 #3
0
 public void TestLongReadRedLight()
 {
     byte[] arr = new byte[sizeof(long)];
     ByteManipulator.Write(arr, 0, (long)-25);
     Assert.That(ByteManipulator.ReadInt64(arr, 0), Is.Not.EqualTo(9));
 }
コード例 #4
0
 public void TestLongRead()
 {
     byte[] arr = new byte[sizeof(long)];
     ByteManipulator.Write(arr, 0, (long)-250000000000001);
     Assert.That(ByteManipulator.ReadInt64(arr, 0), Is.EqualTo(-250000000000001));
 }