久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <small id='nPqPs'></small><noframes id='nPqPs'>

        <i id='nPqPs'><tr id='nPqPs'><dt id='nPqPs'><q id='nPqPs'><span id='nPqPs'><b id='nPqPs'><form id='nPqPs'><ins id='nPqPs'></ins><ul id='nPqPs'></ul><sub id='nPqPs'></sub></form><legend id='nPqPs'></legend><bdo id='nPqPs'><pre id='nPqPs'><center id='nPqPs'></center></pre></bdo></b><th id='nPqPs'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='nPqPs'><tfoot id='nPqPs'></tfoot><dl id='nPqPs'><fieldset id='nPqPs'></fieldset></dl></div>
      1. <legend id='nPqPs'><style id='nPqPs'><dir id='nPqPs'><q id='nPqPs'></q></dir></style></legend>
      2. <tfoot id='nPqPs'></tfoot>
        • <bdo id='nPqPs'></bdo><ul id='nPqPs'></ul>

        Json.NET 可以對流進行序列化/反序列化嗎?

        Can Json.NET serialize / deserialize to / from a stream?(Json.NET 可以對流進行序列化/反序列化嗎?)
        <legend id='g5vgi'><style id='g5vgi'><dir id='g5vgi'><q id='g5vgi'></q></dir></style></legend>

            <i id='g5vgi'><tr id='g5vgi'><dt id='g5vgi'><q id='g5vgi'><span id='g5vgi'><b id='g5vgi'><form id='g5vgi'><ins id='g5vgi'></ins><ul id='g5vgi'></ul><sub id='g5vgi'></sub></form><legend id='g5vgi'></legend><bdo id='g5vgi'><pre id='g5vgi'><center id='g5vgi'></center></pre></bdo></b><th id='g5vgi'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='g5vgi'><tfoot id='g5vgi'></tfoot><dl id='g5vgi'><fieldset id='g5vgi'></fieldset></dl></div>
              <bdo id='g5vgi'></bdo><ul id='g5vgi'></ul>

                <small id='g5vgi'></small><noframes id='g5vgi'>

                    <tbody id='g5vgi'></tbody>

                  <tfoot id='g5vgi'></tfoot>
                  本文介紹了Json.NET 可以對流進行序列化/反序列化嗎?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  聽說Json.NET比DataContractJsonSerializer快,想試一試……

                  I have heard that Json.NET is faster than DataContractJsonSerializer, and wanted to give it a try...

                  但我在 JsonConvert 上找不到任何采用流而不是字符串的方法.

                  But I couldn't find any methods on JsonConvert that take a stream rather than a string.

                  以在WinPhone上反序列化包含JSON的文件為例,我使用以下代碼將文件內容讀入字符串,然后反序列化為JSON.在我的(非常臨時的)測試中,它似乎比使用 DataContractJsonSerializer 直接從流中反序列化慢了大約 4 倍......

                  For deserializing a file containing JSON on WinPhone, for example, I use the following code to read the file contents into a string, and then deserialize into JSON. It appears to be about 4 times slower in my (very ad-hoc) testing than using DataContractJsonSerializer to deserialize straight from the stream...

                  // DCJS
                  DataContractJsonSerializer dc = new DataContractJsonSerializer(typeof(Constants));
                  Constants constants = (Constants)dc.ReadObject(stream);
                  
                  // JSON.NET
                  string json = new StreamReader(stream).ReadToEnd();
                  Constants constants = JsonConvert.DeserializeObject<Constants>(json);
                  

                  我做錯了嗎?

                  推薦答案

                  更新: 這在當前版本中不再有效,請參閱 下方獲取正確答案(無需投票,這在舊版本上是正確的).

                  UPDATE: This no longer works in the current version, see below for correct answer (no need to vote down, this is correct on older versions).

                  JsonTextReader 類與 StreamReader 一起使用,或直接使用采用 StreamReaderJsonSerializer 重載:

                  Use the JsonTextReader class with a StreamReader or use the JsonSerializer overload that takes a StreamReader directly:

                  var serializer = new JsonSerializer();
                  serializer.Deserialize(streamReader);
                  

                  這篇關于Json.NET 可以對流進行序列化/反序列化嗎?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Ignore whitespace while reading XML(讀取 XML 時忽略空格)
                  extracting just page text using HTMLAgilityPack(使用 HTMLAgilityPack 僅提取頁面文本)
                  C# extracting data from XML(C# 從 XML 中提取數據)
                  Read a XML (from a string) and get some fields - Problems reading XML(讀取 XML(從字符串)并獲取一些字段 - 讀取 XML 時出現問題)
                  Reading large XML documents in .net(在 .net 中讀取大型 XML 文檔)
                  How to create folder in Google Drive using .NET API?(如何使用 .NET API 在 Google Drive 中創建文件夾?)
                • <i id='btiaW'><tr id='btiaW'><dt id='btiaW'><q id='btiaW'><span id='btiaW'><b id='btiaW'><form id='btiaW'><ins id='btiaW'></ins><ul id='btiaW'></ul><sub id='btiaW'></sub></form><legend id='btiaW'></legend><bdo id='btiaW'><pre id='btiaW'><center id='btiaW'></center></pre></bdo></b><th id='btiaW'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='btiaW'><tfoot id='btiaW'></tfoot><dl id='btiaW'><fieldset id='btiaW'></fieldset></dl></div>

                • <tfoot id='btiaW'></tfoot>

                      <small id='btiaW'></small><noframes id='btiaW'>

                        <bdo id='btiaW'></bdo><ul id='btiaW'></ul>

                            <tbody id='btiaW'></tbody>
                          • <legend id='btiaW'><style id='btiaW'><dir id='btiaW'><q id='btiaW'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 欧美一区二区三区大片 | 草草草影院| www.黄色在线观看 | 成人精品在线视频 | 毛片日韩| 亚洲有码转帖 | 国产资源在线观看 | 中文字幕一区在线 | 亚洲不卡在线观看 | 一区二区三区 在线 | 国产福利在线看 | 91在线看 | 日本三级网址 | 999re5这里只有精品 | 日韩激情一区 | 99热国产在线播放 | 成人精品国产 | 成人精品一区二区 | 日本欧美在线观看视频 | 成人免费看黄网站在线观看 | 欧美白人做受xxxx视频 | 毛片毛片毛片毛片 | 亚洲成人福利视频 | 亚洲国产二区 | 狠狠干2020 | 午夜视频免费在线观看 | 国产7777| 精品久久影院 | 在线高清免费观看视频 | 天堂在线中文 | 一区二区三区国产好 | 琪琪午夜伦伦电影福利片 | 99久久国产综合精品麻豆 | 久精品久久 | 91精品国产91久久久久久吃药 | 国产午夜精品久久 | 久久国内精品 | 欧美一区二区三区在线 | 夜夜骑首页 | 国产一区二区三区四区三区四 | 欧美网站一区二区 |