本文整理匯總了C#中System.IO.BinaryReader.ReadUInt256方法的典型用法代碼示例。如果您正苦於以下問題:C# BinaryReader.ReadUInt256方法的具體用法?C# BinaryReader.ReadUInt256怎麽用?C# BinaryReader.ReadUInt256使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.IO.BinaryReader
的用法示例。
在下文中一共展示了BinaryReader.ReadUInt256方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DecodeGetBlocksPayload
public static GetBlocksPayload DecodeGetBlocksPayload(BinaryReader reader)
{
return new GetBlocksPayload
(
Version: reader.ReadUInt32(),
BlockLocatorHashes: reader.ReadList(() => reader.ReadUInt256()),
HashStop: reader.ReadUInt256()
);
}
示例2: DecodeBlockHeader
public static BlockHeader DecodeBlockHeader(BinaryReader reader, UInt256 blockHash = null)
{
return new BlockHeader
(
version: reader.ReadUInt32(),
previousBlock: reader.ReadUInt256(),
merkleRoot: reader.ReadUInt256(),
time: reader.ReadUInt32(),
bits: reader.ReadUInt32(),
nonce: reader.ReadUInt32(),
hash: blockHash
);
}
示例3: DecodeBlockTx
public static BlockTx DecodeBlockTx(BinaryReader reader, bool skipTx = false)
{
var index = reader.ReadInt32();
var depth = reader.ReadInt32();
var hash = reader.ReadUInt256();
var pruned = reader.ReadBool();
if (!pruned && !skipTx)
{
var tx = DecodeTransaction(reader, hash);
return new BlockTx(index, depth, hash, pruned, tx);
}
else
return new BlockTx(index, depth, hash, pruned, null);
}
示例4: DecodeInventoryVector
public static InventoryVector DecodeInventoryVector(BinaryReader reader)
{
return new InventoryVector
(
Type: reader.ReadUInt32(),
Hash: reader.ReadUInt256()
);
}
示例5: DecodeChainedHeader
public static ChainedHeader DecodeChainedHeader(BinaryReader reader)
{
var blockHash = reader.ReadUInt256();
return new ChainedHeader
(
blockHeader: DecodeBlockHeader(reader, blockHash),
height: reader.ReadInt32(),
totalWork: new BigInteger(reader.ReadVarBytes())
);
}
示例6: DecodeUnmintedTx
public static UnmintedTx DecodeUnmintedTx(BinaryReader reader)
{
return new UnmintedTx(
txHash: reader.ReadUInt256(),
prevOutputTxKeys: reader.ReadList(() => DecodeTxLookupKey(reader))
);
}
示例7: DecodeUnspentTx
public static UnspentTx DecodeUnspentTx(BinaryReader reader)
{
return new UnspentTx(
txHash: reader.ReadUInt256(),
blockIndex: reader.ReadInt32(),
txIndex: reader.ReadInt32(),
outputStates: new OutputStates(
bytes: reader.ReadVarBytes(),
length: reader.ReadInt32())
);
}
示例8: DecodeUInt256
public static UInt256 DecodeUInt256(BinaryReader reader)
{
return reader.ReadUInt256();
}
示例9: DecodeTxOutputKey
public static TxOutputKey DecodeTxOutputKey(BinaryReader reader)
{
return new TxOutputKey
(
txHash: reader.ReadUInt256(),
txOutputIndex: reader.ReadUInt32()
);
}
示例10: DecodeTxLookupKey
public static TxLookupKey DecodeTxLookupKey(BinaryReader reader)
{
return new TxLookupKey(
blockHash: reader.ReadUInt256(),
txIndex: reader.ReadInt32()
);
}
示例11: DecodeTxInput
public static TxInput DecodeTxInput(BinaryReader reader)
{
return new TxInput
(
previousTxOutputKey: new TxOutputKey
(
txHash: reader.ReadUInt256(),
txOutputIndex: reader.ReadUInt32()
),
scriptSignature: reader.ReadVarBytes().ToImmutableArray(),
sequence: reader.ReadUInt32()
);
}
示例12: DecodeSpentTx
public static SpentTx DecodeSpentTx(BinaryReader reader)
{
return new SpentTx(
txHash: reader.ReadUInt256(),
confirmedBlockIndex: reader.ReadInt32(),
txIndex: reader.ReadInt32()
);
}