當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。