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


C# BinaryWriter.WriteList方法代码示例

本文整理汇总了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);
 }
开发者ID:jonathanyeung,项目名称:ozwego,代码行数:10,代码来源:PlayerGameStats.cs

示例2: EncodeBlockSpentTxes

 public static void EncodeBlockSpentTxes(BinaryWriter writer, BlockSpentTxes blockSpentTxes)
 {
     writer.WriteList(blockSpentTxes, spentTx => EncodeSpentTx(writer, spentTx));
 }
开发者ID:cole2295,项目名称:BitSharp,代码行数:4,代码来源:DataEncoder.cs

示例3: EncodeUnmintedTxList

 public static void EncodeUnmintedTxList(BinaryWriter writer, IImmutableList<UnmintedTx> unmintedTxes)
 {
     writer.WriteList(unmintedTxes, unmintedTx => EncodeUnmintedTx(writer, unmintedTx));
 }
开发者ID:cole2295,项目名称:BitSharp,代码行数:4,代码来源:DataEncoder.cs

示例4: EncodeBlock

 public static void EncodeBlock(BinaryWriter writer, Block block)
 {
     EncodeBlockHeader(writer, block.Header);
     writer.WriteList(block.BlockTxes, tx => writer.WriteBytes(tx.TxBytes.ToArray()));
 }
开发者ID:cole2295,项目名称:BitSharp,代码行数:5,代码来源:DataEncoder.cs

示例5: EncodePrevTxOutputList

 public static void EncodePrevTxOutputList(BinaryWriter writer, ImmutableArray<PrevTxOutput> txOutputs)
 {
     writer.WriteList(txOutputs, output => EncodePrevTxOutput(writer, output));
 }
开发者ID:cole2295,项目名称:BitSharp,代码行数:4,代码来源:DataEncoder.cs

示例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);
        }
开发者ID:ScottIsAFool,项目名称:Speader,代码行数:14,代码来源:CacheService.cs

示例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;
            }
        }
开发者ID:pmlyon,项目名称:BitSharp,代码行数:31,代码来源:EsentChainStateCursor.cs

示例8: EncodeAddressPayload

 public static void EncodeAddressPayload(BinaryWriter writer, AddressPayload addressPayload)
 {
     writer.WriteList(addressPayload.NetworkAddresses, networkAddress => EncodeNetworkAddressWithTime(writer, networkAddress));
 }
开发者ID:cole2295,项目名称:BitSharp,代码行数:4,代码来源:NodeEncoder.cs

示例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;
            }
        }
开发者ID:ArsenShnurkov,项目名称:BitSharp,代码行数:24,代码来源:LmdbChainStateCursor.cs

示例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;
            }
        }
开发者ID:ArsenShnurkov,项目名称:BitSharp,代码行数:24,代码来源:LmdbChainStateCursor.cs

示例11: Write

 public void Write(BinaryWriter writer)
 {
     writer.WriteList(_GameData);
 }
开发者ID:jonathanyeung,项目名称:ozwego,代码行数:4,代码来源:GameDataList.cs

示例12: Write

 public void Write(BinaryWriter writer)
 {
     writer.WriteList(Friends);
 }
开发者ID:jonathanyeung,项目名称:ozwego,代码行数:4,代码来源:FriendList.cs

示例13: EncodeUnmintedTx

 public static void EncodeUnmintedTx(BinaryWriter writer, UnmintedTx unmintedTx)
 {
     writer.WriteUInt256(unmintedTx.TxHash);
     writer.WriteList(unmintedTx.PrevOutputTxKeys, x => EncodeTxLookupKey(writer, x));
 }
开发者ID:ArsenShnurkov,项目名称:BitSharp,代码行数:5,代码来源:DataEncoder.cs

示例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();
            }
        }
开发者ID:ArsenShnurkov,项目名称:BitSharp,代码行数:13,代码来源:DataEncoder.cs

示例15: EncodeBlock

 public static void EncodeBlock(BinaryWriter writer, Block block)
 {
     EncodeBlockHeader(writer, block.Header);
     writer.WriteList(block.Transactions, tx => EncodeTransaction(writer, tx));
 }
开发者ID:ArsenShnurkov,项目名称:BitSharp,代码行数:5,代码来源:DataEncoder.cs


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