本文整理汇总了C#中BinarySerializer.GetDouble方法的典型用法代码示例。如果您正苦于以下问题:C# BinarySerializer.GetDouble方法的具体用法?C# BinarySerializer.GetDouble怎么用?C# BinarySerializer.GetDouble使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BinarySerializer
的用法示例。
在下文中一共展示了BinarySerializer.GetDouble方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deserialization
public void Deserialization()
{
var serializer = new BinarySerializer(DataSerialized);
Assert.AreEqual(true, serializer.GetBool());
Assert.AreEqual((byte)0, serializer.GetByte());
Assert.AreEqual((byte)1, serializer.GetByte());
Assert.AreEqual('b', serializer.GetChar());
Assert.AreEqual((byte)0, serializer.GetByte());
Assert.AreEqual(1d, serializer.GetDouble());
Assert.AreEqual(1d, serializer.GetDouble());
Assert.AreEqual((short)-5, serializer.GetInt16());
Assert.AreEqual(-6, serializer.GetInt32());
Assert.AreEqual(7L, serializer.GetInt64());
Assert.AreEqual((sbyte)-2, serializer.GetSByte());
Assert.AreEqual(1f, serializer.GetFloat());
Assert.AreEqual((ushort)9, serializer.GetUInt16());
Assert.AreEqual(10U, serializer.GetUInt32());
Assert.AreEqual(11UL, serializer.GetUInt64());
Assert.AreEqual(new Version(1, 2, 3, 4), serializer.GetVersion());
}