public void LongCanBeReaded(long value) { // Arrange var data = BitConverter.GetBytes(value); // Act var stream = new DeserializationStream(data); var result = stream.ReadLong(); // Assert result.Should().Be(value); stream.Offset.Should().Be(sizeof(long)); }
protected override DateTime DeserializeInternal(DeserializationStream stream, Type sourceType) { long ticks = stream.ReadLong(); return(DateTime.FromBinary(ticks)); }
protected override long DeserializeInternal(DeserializationStream stream, Type sourceType) { return(stream.ReadLong()); }
protected override TimeSpan DeserializeInternal(DeserializationStream stream, Type sourceType) { long ticks = stream.ReadLong(); return(TimeSpan.FromTicks(ticks)); }