Exemplo n.º 1
0
        public void Should_ReadInt64()
        {
            var bytes  = BitConverter.GetBytes(123435L);
            var stream = new BitStream(bytes);
            var reader = new BitStreamReader(stream);
            var val    = reader.ReadInt64();

            Assert.AreEqual(sizeof(long), stream.Length);
            Assert.AreEqual(123435L, val);
            CollectionAssert.AreEqual(bytes, BitConverter.GetBytes(val));
        }
        public void Test_ReadInt64()
        {
            BitStreamWriter writer = new BitStreamWriter(stream);
            BitStreamReader reader = new BitStreamReader(stream);

            writer.Write(872, 10);
            long result = reader.ReadInt64(_fixture.index, 10);

            _fixture.index += 10;

            Assert.Equal(872, result);
        }
 public static Int64 Deserialize(BitStreamReader reader) => reader.ReadInt64();
 public static void Deserialize(ref DateTime value, BitStreamReader reader)
 {
     value = new DateTime(reader.ReadInt64(), DateTimeKind.Utc);
 }
 public static void Deserialize(ref Int64 value, BitStreamReader reader) => value = reader.ReadInt64();