当前位置: 首页>>代码示例>>C#>>正文


C# BinaryReader.ReadSerializable方法代码示例

本文整理汇总了C#中System.IO.BinaryReader.ReadSerializable方法的典型用法代码示例。如果您正苦于以下问题:C# BinaryReader.ReadSerializable方法的具体用法?C# BinaryReader.ReadSerializable怎么用?C# BinaryReader.ReadSerializable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.BinaryReader的用法示例。


在下文中一共展示了BinaryReader.ReadSerializable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1:

 void ISerializable.Deserialize(BinaryReader reader)
 {
     this.AssetId = reader.ReadSerializable<UInt256>();
     this.Value = reader.ReadSerializable<Fixed8>();
     if (Value <= Fixed8.Zero) throw new FormatException();
     this.ScriptHash = reader.ReadSerializable<UInt160>();
 }
开发者ID:zhengger,项目名称:AntShares,代码行数:7,代码来源:TransactionOutput.cs

示例2: DeserializeUnsignedInternal

 void ISignable.DeserializeUnsigned(BinaryReader reader)
 {
     UInt256 asset_id = reader.ReadSerializable<UInt256>();
     UInt256 value_asset_id = reader.ReadSerializable<UInt256>();
     if (asset_id == value_asset_id) throw new FormatException();
     UInt160 agent = reader.ReadSerializable<UInt160>();
     DeserializeUnsignedInternal(reader, asset_id, value_asset_id, agent);
 }
开发者ID:4T-Shirt,项目名称:AntShares,代码行数:8,代码来源:Order.cs

示例3:

 void ISerializable.Deserialize(BinaryReader reader)
 {
     this.Amount = reader.ReadSerializable<Fixed8>();
     if (Amount == Fixed8.Zero) throw new FormatException();
     if (Amount.GetData() % 10000 != 0) throw new FormatException();
     this.Price = reader.ReadSerializable<Fixed8>();
     if (Price <= Fixed8.Zero) throw new FormatException();
     if (Price.GetData() % 10000 != 0) throw new FormatException();
     this.Client = reader.ReadSerializable<UInt160>();
 }
开发者ID:zhengger,项目名称:AntShares,代码行数:10,代码来源:SplitOrder.cs

示例4:

 void ISignable.DeserializeUnsigned(BinaryReader reader)
 {
     PrevHash = reader.ReadSerializable<UInt256>();
     Miner = ECPoint.DeserializeFrom(reader, ECCurve.Secp256r1);
     NoncePieces.Clear();
     int count = (int)reader.ReadVarInt();
     for (int i = 0; i < count; i++)
     {
         ECPoint key = ECPoint.DeserializeFrom(reader, ECCurve.Secp256r1);
         byte[] value = reader.ReadBytes((int)reader.ReadVarInt());
         NoncePieces.Add(key, value);
     }
     MerkleRoot = reader.ReadSerializable<UInt256>();
 }
开发者ID:EppoFq,项目名称:AntShares,代码行数:14,代码来源:BlockConsensusResponse.cs

示例5: DeserializeExclusiveData

 protected override void DeserializeExclusiveData(BinaryReader reader)
 {
     this.AssetType = (AssetType)reader.ReadByte();
     if (!Enum.IsDefined(typeof(AssetType), AssetType))
         throw new FormatException();
     this.Name = reader.ReadVarString();
     this.Amount = reader.ReadSerializable<Fixed8>();
     if (Amount == Fixed8.Zero || Amount < -Fixed8.Satoshi) throw new FormatException();
     if (AssetType == AssetType.Share && Amount <= Fixed8.Zero)
         throw new FormatException();
     if (AssetType == AssetType.Currency && Amount != -Fixed8.Satoshi)
         throw new FormatException();
     this.Issuer = ECPoint.DeserializeFrom(reader, ECCurve.Secp256r1);
     this.Admin = reader.ReadSerializable<UInt160>();
 }
开发者ID:zhengger,项目名称:AntShares,代码行数:15,代码来源:RegisterTransaction.cs

示例6:

 void ISerializable.Deserialize(BinaryReader reader)
 {
     this.PrevHash = reader.ReadSerializable<UInt256>();
     this.PrevIndex = reader.ReadUInt32();
     this.Script = reader.ReadBytes((int)reader.ReadVarInt());
     this.Sequence = reader.ReadUInt32();
 }
开发者ID:erikzhang,项目名称:IceWallet,代码行数:7,代码来源:TransactionInput.cs

示例7: DeserializeUnsignedInternal

 private void DeserializeUnsignedInternal(BinaryReader reader, UInt256 asset_id, UInt256 value_asset_id, UInt160 agent)
 {
     AssetId = asset_id;
     ValueAssetId = value_asset_id;
     Agent = agent;
     Amount = reader.ReadSerializable<Fixed8>();
     if (Amount == Fixed8.Zero) throw new FormatException();
     if (Amount.GetData() % 10000 != 0) throw new FormatException();
     Price = reader.ReadSerializable<Fixed8>();
     if (Price <= Fixed8.Zero) throw new FormatException();
     if (Price.GetData() % 10000 != 0) throw new FormatException();
     Client = reader.ReadSerializable<UInt160>();
     Inputs = reader.ReadSerializableArray<TransactionInput>();
     if (Inputs.Distinct().Count() != Inputs.Length)
         throw new FormatException();
 }
开发者ID:zhengger,项目名称:AntShares,代码行数:16,代码来源:Order.cs

示例8:

 void ISignable.DeserializeUnsigned(BinaryReader reader)
 {
     PrevHash = reader.ReadSerializable<UInt256>();
     Miner = ECPoint.DeserializeFrom(reader, ECCurve.Secp256r1);
     IV = reader.ReadBytes(16);
     NoncePieces.Clear();
     int count = (int)reader.ReadVarInt();
     for (int i = 0; i < count; i++)
     {
         ECPoint key = ECPoint.DeserializeFrom(reader, ECCurve.Secp256r1);
         if (key == Miner) throw new FormatException();
         byte[] value = reader.ReadBytes((int)reader.ReadVarInt());
         NoncePieces.Add(key, value);
     }
     NonceHash = reader.ReadSerializable<UInt256>();
     TransactionHashes = reader.ReadSerializableArray<UInt256>();
 }
开发者ID:EppoFq,项目名称:AntShares,代码行数:17,代码来源:BlockConsensusRequest.cs

示例9: Deserialize

 public override void Deserialize(BinaryReader reader)
 {
     this.PrevHash = reader.ReadSerializable<UInt256>();
     this.Miner = Secp256r1Point.DeserializeFrom(reader);
     this.NoncePieces.Clear();
     int count = (int)reader.ReadVarInt();
     for (int i = 0; i < count; i++)
     {
         Secp256r1Point key = Secp256r1Point.DeserializeFrom(reader);
         if (key == Miner) throw new FormatException();
         byte[] value = reader.ReadBytes((int)reader.ReadVarInt());
         NoncePieces.Add(key, value);
     }
     this.NonceHash = reader.ReadSerializable<UInt256>();
     this.TransactionHashes = reader.ReadSerializableArray<UInt256>();
     this.Script = reader.ReadBytes((int)reader.ReadVarInt());
 }
开发者ID:imcoddy,项目名称:AntShares,代码行数:17,代码来源:BlockConsensusRequest.cs

示例10: Deserialize

 public override void Deserialize(BinaryReader reader)
 {
     this.m = (int)reader.ReadVarInt();
     this.publicKeys = new ECPoint[reader.ReadVarInt()];
     for (int i = 0; i < publicKeys.Length; i++)
     {
         publicKeys[i] = ECPoint.DeserializeFrom(reader, ECCurve.Secp256r1);
     }
     base.RedeemScript = CreateMultiSigRedeemScript(m, publicKeys);
     base.PublicKeyHash = reader.ReadSerializable<UInt160>();
 }
开发者ID:zhengger,项目名称:AntShares,代码行数:11,代码来源:MultiSigContract.cs

示例11: DeserializeExclusiveData

 protected override void DeserializeExclusiveData(BinaryReader reader)
 {
     this.AssetId = reader.ReadSerializable<UInt256>();
     this.ValueAssetId = reader.ReadSerializable<UInt256>();
     if (AssetId == ValueAssetId) throw new FormatException();
     this.Agent = reader.ReadSerializable<UInt160>();
     this.Orders = new Order[reader.ReadVarInt()];
     for (int i = 0; i < Orders.Length; i++)
     {
         Orders[i] = new Order();
         Orders[i].DeserializeInTransaction(reader, this);
     }
     ulong count = reader.ReadVarInt();
     if (count > 1) throw new FormatException();
     if (count == 0)
     {
         this.SplitOrder = null;
     }
     else
     {
         this.SplitOrder = reader.ReadSerializable<SplitOrder>();
     }
 }
开发者ID:zhengger,项目名称:AntShares,代码行数:23,代码来源:AgencyTransaction.cs

示例12: using

 void ISignable.FromUnsignedArray(byte[] value)
 {
     using (MemoryStream ms = new MemoryStream(value, false))
     using (BinaryReader reader = new BinaryReader(ms))
     {
         this.AssetId = reader.ReadSerializable<UInt256>();
         this.ValueAssetId = reader.ReadSerializable<UInt256>();
         this.Agent = reader.ReadSerializable<UInt160>();
         this.Amount = reader.ReadSerializable<Fixed8>();
         this.Price = reader.ReadSerializable<Fixed8>();
         this.Client = reader.ReadSerializable<UInt160>();
         this.Inputs = reader.ReadSerializableArray<TransactionInput>();
     }
 }
开发者ID:imcoddy,项目名称:AntShares,代码行数:14,代码来源:Order.cs

示例13: using

 void ISignable.FromUnsignedArray(byte[] value)
 {
     using (MemoryStream ms = new MemoryStream(value, false))
     using (BinaryReader reader = new BinaryReader(ms))
     {
         this.PrevHash = reader.ReadSerializable<UInt256>();
         this.Miner = Secp256r1Point.DeserializeFrom(reader);
         this.NoncePieces.Clear();
         int count = (int)reader.ReadVarInt();
         for (int i = 0; i < count; i++)
         {
             Secp256r1Point key = Secp256r1Point.DeserializeFrom(reader);
             if (key == Miner) throw new FormatException();
             value = reader.ReadBytes((int)reader.ReadVarInt());
             NoncePieces.Add(key, value);
         }
         this.NonceHash = reader.ReadSerializable<UInt256>();
         this.TransactionHashes = reader.ReadSerializableArray<UInt256>();
     }
 }
开发者ID:imcoddy,项目名称:AntShares,代码行数:20,代码来源:BlockConsensusRequest.cs

示例14:

 void ISerializable.Deserialize(BinaryReader reader)
 {
     this.Version = reader.ReadUInt32();
     this.HashStart = reader.ReadSerializableArray<UInt256>();
     this.HashStop = reader.ReadSerializable<UInt256>();
 }
开发者ID:erikzhang,项目名称:IceWallet,代码行数:6,代码来源:GetBlocksPayload.cs

示例15: Deserialize

 public override void Deserialize(BinaryReader reader)
 {
     ((ISignable)this).DeserializeUnsigned(reader);
     Script = reader.ReadSerializable<Script>();
 }
开发者ID:EppoFq,项目名称:AntShares,代码行数:5,代码来源:BlockConsensusRequest.cs


注:本文中的System.IO.BinaryReader.ReadSerializable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。