Protobuff序列化System.Numerics.BigInteger

汤姆·古伦

编码:

[ProtoMember(11002)]
public BigInteger StartInteger { get; private set; }

引发异常:

No serializer defined for type: System.Numerics.BigInteger

如何使StartInteger序列化?

汤姆·古伦

通过执行以下操作设法解决了这个问题:

public BigInteger StartInteger { get; private set; }
[ProtoMember(11002, DataFormat = DataFormat.FixedSize)]
private byte[] StartIntegerSerialized
{
    get { return StartInteger.ToByteArray(); }
    set { StartInteger = new BigInteger(value); }
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

什么是Org.BouncyCastle.Math.BigInteger.ToByteArrayUnsigned的.NET System.Numerics.BigInteger等效项?

System.Numerics.dll中的BigInteger类型和FSharp.Core.dll中的BigInteger类型之间有什么区别?

尝试使用protobuf-net序列化System.Numerics.Quaternion

PHP:反序列化 Java 的 BigInteger

无法将类型'System.Numerics.BigInteger'隐式转换为'int'。存在显式转换(您是否缺少演员表?)

自定义BigInteger JSON序列化器

Java Fibonocci序列BigInteger

缺少System.Numerics.Vectors.Vector <T>

System.Numerics.Vector.GreaterThan and bool结果

System.Numerics.Vector <int>仅部分初始化

System.Numerics.Vector.ConditionalSelect用来做什么?

包装昂贵的System.Numerics.VectorX-为什么?

大数据集上的System.Numerics.Vector <T>

使用System.Numerics.Vectors旋转2D点

C#哪里可以下载System.Numerics

带有 BigInteger 索引的 F# 序列

初始化java.math.BigInteger

Java中Biginteger的初始化

将BigDecimal / BigInteger序列化为ProtocolBuffers的最佳方法是什么

System.Numerics.Vectors'Vector <T>':基本上只是System.UInt128吗?

在System.Numerics.Vector <T>中使用F#度量单位

使用System.Numerics进行矩阵乘法的完全错误的值

我如何在MonoDevelop中的Mono C#中使用System.Numerics?

为什么需要用这个简单的LINQ表达式引用System.Numerics?

C#SIMD使用System.Numerics.Vector进行排序/中位数

如何在C#中获取System.Numerics.Vector的元素?

.NET Framework上System.Numerics.Vector <T>的初始化性能

C#中包含System.Numerics.Vector <double>的结构的指针

VS Code Omnisharp.MsBuild.Projectmanager无法加载程序集System.Numerics.Vectors 4.1.3.0