本文整理汇总了C#中System.IO.BinaryWriter.WriteList方法的典型用法代码示例。如果您正苦于以下问题:C# BinaryWriter.WriteList方法的具体用法?C# BinaryWriter.WriteList怎么用?C# BinaryWriter.WriteList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.BinaryWriter
的用法示例。
在下文中一共展示了BinaryWriter.WriteList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
public void Write(BinaryWriter writer)
{
writer.Write(NumberOfPeels);
writer.Write(PerformedFirstPeel);
writer.Write(AvgTimeBetweenPeels);
writer.Write(NumberOfDumps);
writer.Write(AvgTimeBetweenDumps);
writer.Write(IsWinner);
writer.WriteList(RawGameData);
}
示例2: EncodeBlockSpentTxes
public static void EncodeBlockSpentTxes(BinaryWriter writer, BlockSpentTxes blockSpentTxes)
{
writer.WriteList(blockSpentTxes, spentTx => EncodeSpentTx(writer, spentTx));
}
示例3: EncodeUnmintedTxList
public static void EncodeUnmintedTxList(BinaryWriter writer, IImmutableList<UnmintedTx> unmintedTxes)
{
writer.WriteList(unmintedTxes, unmintedTx => EncodeUnmintedTx(writer, unmintedTx));
}
示例4: EncodeBlock
public static void EncodeBlock(BinaryWriter writer, Block block)
{
EncodeBlockHeader(writer, block.Header);
writer.WriteList(block.BlockTxes, tx => writer.WriteBytes(tx.TxBytes.ToArray()));
}
示例5: EncodePrevTxOutputList
public static void EncodePrevTxOutputList(BinaryWriter writer, ImmutableArray<PrevTxOutput> txOutputs)
{
writer.WriteList(txOutputs, output => EncodePrevTxOutput(writer, output));
}
示例6: WriteItemsToDisk
private async Task WriteItemsToDisk(IList<ReaderItem> items, SourceProvider source)
{
var filename = GetFileName(GetCacheFile(source));
using (var file = await _storage.Local.CreateFileAsync(filename))
{
using (var writer = new BinaryWriter(file))
{
writer.WriteList(items);
}
}
await SetSinceDate(source, DateTime.Now).ConfigureAwait(false);
}
示例7: TryAddBlockSpentTxes
public bool TryAddBlockSpentTxes(int blockIndex, BlockSpentTxes spentTxes)
{
CheckWriteTransaction();
try
{
using (SetSessionContext())
using (var jetUpdate = this.jetSession.BeginUpdate(this.spentTxTableId, JET_prep.Insert))
{
byte[] spentTxesBytes;
using (var stream = new MemoryStream())
using (var writer = new BinaryWriter(stream))
{
writer.WriteList<SpentTx>(spentTxes, spentTx => DataEncoder.EncodeSpentTx(writer, spentTx));
spentTxesBytes = stream.ToArray();
}
Api.SetColumns(this.jetSession, this.spentTxTableId,
new Int32ColumnValue { Columnid = this.spentSpentBlockIndexColumnId, Value = blockIndex },
new BytesColumnValue { Columnid = this.spentDataColumnId, Value = spentTxesBytes });
jetUpdate.Save();
}
return true;
}
catch (EsentKeyDuplicateException)
{
return false;
}
}
示例8: EncodeAddressPayload
public static void EncodeAddressPayload(BinaryWriter writer, AddressPayload addressPayload)
{
writer.WriteList(addressPayload.NetworkAddresses, networkAddress => EncodeNetworkAddressWithTime(writer, networkAddress));
}
示例9: TryAddBlockUnmintedTxes
public bool TryAddBlockUnmintedTxes(UInt256 blockHash, IImmutableList<UnmintedTx> unmintedTxes)
{
CheckWriteTransaction();
var key = DbEncoder.EncodeUInt256(blockHash);
if (!this.txn.ContainsKey(blockUnmintedTxesTableId, key))
{
byte[] unmintedTxesBytes;
using (var stream = new MemoryStream())
using (var writer = new BinaryWriter(stream))
{
writer.WriteList(unmintedTxes, unmintedTx => DataEncoder.EncodeUnmintedTx(writer, unmintedTx));
unmintedTxesBytes = stream.ToArray();
}
this.txn.Put(blockUnmintedTxesTableId, key, unmintedTxesBytes);
return true;
}
else
{
return false;
}
}
示例10: TryAddBlockSpentTxes
public bool TryAddBlockSpentTxes(int blockIndex, BlockSpentTxes spentTxes)
{
CheckWriteTransaction();
var key = DbEncoder.EncodeInt32(blockIndex);
if (!this.txn.ContainsKey(blockSpentTxesTableId, key))
{
byte[] spentTxesBytes;
using (var stream = new MemoryStream())
using (var writer = new BinaryWriter(stream))
{
writer.WriteList(spentTxes, spentTx => DataEncoder.EncodeSpentTx(writer, spentTx));
spentTxesBytes = stream.ToArray();
}
this.txn.Put(blockSpentTxesTableId, key, spentTxesBytes);
return true;
}
else
{
return false;
}
}
示例11: Write
public void Write(BinaryWriter writer)
{
writer.WriteList(_GameData);
}
示例12: Write
public void Write(BinaryWriter writer)
{
writer.WriteList(Friends);
}
示例13: EncodeUnmintedTx
public static void EncodeUnmintedTx(BinaryWriter writer, UnmintedTx unmintedTx)
{
writer.WriteUInt256(unmintedTx.TxHash);
writer.WriteList(unmintedTx.PrevOutputTxKeys, x => EncodeTxLookupKey(writer, x));
}
示例14: EncodeTransaction
public static byte[] EncodeTransaction(UInt32 Version, ImmutableArray<TxInput> Inputs, ImmutableArray<TxOutput> Outputs, UInt32 LockTime)
{
using (var stream = new MemoryStream())
using (var writer = new BinaryWriter(stream))
{
writer.WriteUInt32(Version);
writer.WriteList(Inputs, input => EncodeTxInput(writer, input));
writer.WriteList(Outputs, output => EncodeTxOutput(writer, output));
writer.WriteUInt32(LockTime);
return stream.ToArray();
}
}
示例15: EncodeBlock
public static void EncodeBlock(BinaryWriter writer, Block block)
{
EncodeBlockHeader(writer, block.Header);
writer.WriteList(block.Transactions, tx => EncodeTransaction(writer, tx));
}