??xml version="1.0" encoding="utf-8" standalone="yes"?>ԱƱ̳:BlogJava - 2017ϹƱ̳ͼ//www.scdqe.tw/专注于Java技?/description>zh-cnWed, 17 Jul 2019 09:31:27 GMTWed, 17 Jul 2019 09:31:27 GMT60DDD小结 - 2017ϹƱ̳ͼ//www.scdqe.tw/fool/archive/2019/07/08/434108.html? ?/dc:creator>? ?/author>Mon, 08 Jul 2019 08:49:00 GMT//www.scdqe.tw/fool/archive/2019/07/08/434108.html//www.scdqe.tw/fool/comments/434108.html//www.scdqe.tw/fool/archive/2019/07/08/434108.html#Feedback0//www.scdqe.tw/fool/comments/commentRss/434108.html//www.scdqe.tw/fool/services/trackbacks/434108.html阅读全文

]]>
CLC Genomics Workbench 12.0.2 破解 - 2017ϹƱ̳ͼ//www.scdqe.tw/galaxyp/archive/2019/07/07/434089.html舵手舵手Sun, 07 Jul 2019 04:35:00 GMT//www.scdqe.tw/galaxyp/archive/2019/07/07/434089.html//www.scdqe.tw/galaxyp/comments/434089.html//www.scdqe.tw/galaxyp/archive/2019/07/07/434089.html#Feedback0//www.scdqe.tw/galaxyp/comments/commentRss/434089.html//www.scdqe.tw/galaxyp/services/trackbacks/434089.html与N年前比,确实强了太多?br />


舵手 2019-07-07 12:35 发表评论
]]>
史上最强Java NIO入门:担心从入门到放弃的,请读这篇! - 2017ϹƱ̳ͼ//www.scdqe.tw/jb2011/archive/2019/06/29/434008.htmlJack JiangJack JiangSat, 29 Jun 2019 14:17:00 GMT//www.scdqe.tw/jb2011/archive/2019/06/29/434008.html//www.scdqe.tw/jb2011/comments/434008.html//www.scdqe.tw/jb2011/archive/2019/06/29/434008.html#Feedback0//www.scdqe.tw/jb2011/comments/commentRss/434008.html//www.scdqe.tw/jb2011/services/trackbacks/434008.html阅读全文

Jack Jiang 2019-06-29 22:17 发表评论
]]>
少啰嗦!一分钟带你读懂Java的NIO和经典IO的区?/title><link>//www.scdqe.tw/jb2011/archive/2019/06/25/433956.html</link><dc:creator>Jack Jiang</dc:creator><author>Jack Jiang</author><pubDate>Tue, 25 Jun 2019 08:32:00 GMT</pubDate><guid>//www.scdqe.tw/jb2011/archive/2019/06/25/433956.html</guid><wfw:comment>//www.scdqe.tw/jb2011/comments/433956.html</wfw:comment><comments>//www.scdqe.tw/jb2011/archive/2019/06/25/433956.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.scdqe.tw/jb2011/comments/commentRss/433956.html</wfw:commentRss><trackback:ping>//www.scdqe.tw/jb2011/services/trackbacks/433956.html</trackback:ping><description><![CDATA[<h1>ԱƱ̳:1、引言</h1><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">很多初涉网络编程的程序员,在研究Java NIO(即异步IO)和经典IO(也就是常说的阻塞式IO)的API时,很快就会发现一个问题:我什么时候应该使用经典IO,什么时候应该使用NIO?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">在本文中,将尝试用简明扼要的文字,阐明Java NIO和经典IO之间的差异、典型用例,以及这些差异如何影响我们的网络编程或数据传输代码的设计和实现的?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">本文没有复杂理论,也没有像网上基它文章一样千篇一律的复制粘贴,有的只是接地气的通俗易懂,希望能给你带来帮助?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="color: #000000; font-family: "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px;">(本文同步发布于?/span><a target="_blank" data-mce- style="font-family: "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px;">//www.52im.net/thread-2635-1-1.html</a><span style="color: #000000; font-family: "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px;">?/span></p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px; text-align: center; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="box-sizing: border-box; position: relative; z-index: 100; background-color: transparent; transition: background-color 0.1s linear 0s; margin: 0px auto; max-width: 600px; max-height: 338px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 337.969px;"></div><div data-width="600" data-height="338" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 600px; height: 337.969px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/1500839-ebba96b917fb0245.jpeg" src="//upload-images.jianshu.io/upload_images/1500839-ebba96b917fb0245.jpeg" data-original-width="600" data-original-height="338" data-original-format="image/jpeg" data-original-filesize="21908" style="box-sizing: border-box; border: 0px; vertical-align: middle; transition: all 0.15s linear 0s; z-index: 100; opacity: 1; max-width: 100%; height: auto; cursor: zoom-in; display: block; filter: blur(0px);" alt="" /></div></div></div><h1 class="bld">2、相关文?/h1><blockquote style="box-sizing: border-box; padding: 20px; margin: 0px 0px 25px; font-size: 16px; border-left-width: 6px; border-left-color: #b4b4b4; background-color: #f7f7f7; line-height: 30px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; word-break: break-word !important;"><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;"></p><ul style="overflow-wrap: break-word; margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: "Helvetica Neue", Helvetica, Verdana, sans-serif, "Microsoft Yahei"; font-size: 15px; background-color: #ffffff;"><li style="overflow-wrap: break-word; margin: 0px 0px 5px 2em; padding: 0px; list-style: disc; font-size: 14px; color: #666666;">?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">Java新一代网络编程模型AIO原理及Linux系统AIO介绍</a>?/li><li style="overflow-wrap: break-word; margin: 0px 0px 5px 2em; padding: 0px; list-style: disc; font-size: 14px; color: #666666;">?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">Java NIO基础视频教程、MINA视频教程、Netty快速入门视?[网盘下载]</a>?/li></ul><p style="box-sizing: border-box; margin: 0px; line-height: 1.7; word-break: break-word !important;"></p></blockquote><h1 class="bld">3、Java NIO和IO的主要区?/h1><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">下表总结了Java NIO和IO之间的主要区别。我将在表格后面的部分中详细介绍每个区别?/p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px; text-align: center; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="box-sizing: border-box; position: relative; z-index: 100; background-color: transparent; transition: background-color 0.1s linear 0s; margin: 0px auto; max-width: 700px; max-height: 167px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 142.234px;"></div><div data-width="822" data-height="167" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 700px; height: 142.234px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/1500839-ee0a0dbe7ba00d41.jpg" src="//upload-images.jianshu.io/upload_images/1500839-ee0a0dbe7ba00d41.jpg" data-original-width="822" data-original-height="167" data-original-format="image/jpeg" data-original-filesize="17001" style="box-sizing: border-box; border: 0px; vertical-align: middle; transition: all 0.15s linear 0s; z-index: 100; opacity: 1; max-width: 100%; height: auto; cursor: zoom-in; display: block; filter: blur(0px);" alt="" /></div></div></div><h4>3.1 Stream Oriented vs. Buffer Oriented</h4><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">Java NIO和IO之间的第一个重要区别是IO是面向流的,其中NIO是面向缓冲区的。那么,这意味着什么?</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">面向流的Java IO意味着您可以从流中一次读取一个或多个字节。你对读取的字节做什么取决于你。它们不会缓存在任何地方。此外,您无法在流中的数据中前后移动。如果需要在从流中读取的数据中前后移动,则需要先将其缓存在缓冲区中?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">Java NIO的面向缓冲区的方法略有不同。数据被读入缓冲区,稍后处理该缓冲区。你可以根据需要在缓冲区中前后移动。这使你在处理过程中具有更大的灵活性。但是,你还需要检查缓冲区是否包含完整处理所需的所有数据。并且,你需要确保在将更多数据读入缓冲区时,不要覆盖尚未处理的缓冲区中的数据?/p><h4>3.2 Blocking vs. Non-blocking IO</h4><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">Java IO的各种流都是blocking的。这意味着,当线程调用read()或write()时,该线程将被阻塞,直到有一些数据要读取,或者数据被完全写入,在此期间,该线程无法执行任何其他操作?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">Java NIO的非阻塞模式允许线程请求从通道读取数据,并且只获取当前可用的内容,或者根本没有数据,如果当前没有数据可用。线程可以继续使用其他内容,而不是在数据可供读取之前保持阻塞状态?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">非阻塞写入也是如此,线程可以请求将某些数据写入通道,但不要等待它完全写入。然后线程可以继续并在同一时间做其他事情?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">线程在IO调用中没有阻塞时花费空闲时间,通常在此期间在其他通道上执行IO。也就是说,单个线程现在可以管理多个输入和输出通道?/p><h1 class="bld">4、Selectors</h1><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">Java NIO的选择器允许单个线程监视多个输入通道。你可以使用选择器注册多个通道,然后使用单个线?#8220;选择”具有可用于处理的输入的通道,或者选择准备写入的通道。这种选择器机制使单个线程可以轻松管理多个通道?/p><h1 class="bld">5、NIO和经典IO如何影响应用程序的设计?</h1><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">选择NIO或IO作为IO工具包可能会影响应用程序设计的以下方?</span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">1)API调用NIO或IO类;</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">2)处理数据;</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">3)用于处理数据的线程数?/p><h4>5.1 API调用</h4><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">当然,使用NIO时的API调用看起来与使用IO时不同。这并不奇怪。而不是仅仅从例如InputStream读取字节的数据字节,必须首先将数据读入缓冲区,然后从那里进行处理?/p><h4>5.2 数据处理</h4><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">使用纯NIO设计与IO设计时,数据处理也会受到影响?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">在IO设计中,您从InputStream或Reader中读取字节的数据字节。想象一下,您正在处理基于行的文本数据流?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">例如?/span></p><blockquote style="box-sizing: border-box; padding: 20px; margin: 0px 0px 25px; font-size: 16px; border-left-width: 6px; border-left-color: #b4b4b4; background-color: #f7f7f7; line-height: 30px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; word-break: break-word !important;"><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">Name: Anna</p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">Age: 25</p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">Email: [url=mailto:anna@mailserver.com]anna@mailserver.com[/url]</p><p style="box-sizing: border-box; margin: 0px; line-height: 1.7; word-break: break-word !important;">Phone: 1234567890</p></blockquote><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">这个文本行流可以像这样处理:</span></p><blockquote style="box-sizing: border-box; padding: 20px; margin: 0px 0px 25px; font-size: 16px; border-left-width: 6px; border-left-color: #b4b4b4; background-color: #f7f7f7; line-height: 30px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; word-break: break-word !important;"><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">InputStream input = ... ; // get the InputStream from the client socket</p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;"><br style="box-sizing: border-box;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">BufferedReader reader = newBufferedReader(newInputStreamReader(input));</p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;"><br style="box-sizing: border-box;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">String nameLine   = reader.readLine();</p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">String ageLine    = reader.readLine();</p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">String emailLine  = reader.readLine();</p><p style="box-sizing: border-box; margin: 0px; line-height: 1.7; word-break: break-word !important;">String phoneLine  = reader.readLine();</p></blockquote><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">注意处理状态是如何,由程序执行的程度决定的。换句话说,一旦第一个reader.readLine()方法返回,您就确定已经读取了整行文本。readLine()会阻塞直到读取整行,这就是原因。您还知道此行包含名称。同样,当第二个readLine()调用返回时,您知道此行包含年龄等?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">正如您所看到的,只有当有新数据要读取时,程序才会进行,并且对于每个步骤,您都知道该数据是什么。一旦执行的线程已经超过读取代码中的某个数据片段,该线程就不会在数据中向后移动(通常不会)?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">此图中还说明了此原则?/span></p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px; text-align: center; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="box-sizing: border-box; position: relative; z-index: 100; background-color: transparent; transition: background-color 0.1s linear 0s; margin: 0px auto; max-width: 342px; max-height: 326px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 325.984px;"></div><div data-width="342" data-height="326" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 342px; height: 325.984px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/1500839-ccb5dfcd37ebdb45.jpg" src="//upload-images.jianshu.io/upload_images/1500839-ccb5dfcd37ebdb45.jpg" data-original-width="342" data-original-height="326" data-original-format="image/jpeg" data-original-filesize="14514" style="box-sizing: border-box; border: 0px; vertical-align: middle; transition: all 0.15s linear 0s; z-index: 100; opacity: 1; max-width: 100%; height: auto; cursor: zoom-in; display: block; filter: blur(0px);" alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">▲ Java IO:从阻塞流中读取数据</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">NIO的实现看起来会有所不同,这是一个简化的例子?/span></p><blockquote style="box-sizing: border-box; padding: 20px; margin: 0px 0px 25px; font-size: 16px; border-left-width: 6px; border-left-color: #b4b4b4; background-color: #f7f7f7; line-height: 30px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; word-break: break-word !important;"><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">ByteBuffer buffer = ByteBuffer.allocate(48);</p><p style="box-sizing: border-box; margin: 0px; line-height: 1.7; word-break: break-word !important;">intbytesRead = inChannel.read(buffer);</p></blockquote><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">注意第二行从通道读取字节到ByteBuffer。当该方法调用返回时,您不知道所需的所有数据是否都在缓冲区内。你只知道缓冲区包含一些字节,这使得处理更加困难?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">想象一下,在第一次读取(缓冲)调用之后,是否所有读入缓冲区的内容都是半行。例如,“姓名:An”。你能处理这些数据吗?并不是的。在完成任何数据的处理之前,您需要等待至少一整行数据进入缓冲区?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">那么你怎么知道缓冲区是否包含足够的数据来处理它?好吧,你没有。找出的唯一方法是查看缓冲区中的数据。结果是,在您知道所有数据是否存在之前,您可能需要多次检查缓冲区中的数据。这既低效又可能在程序设计方面变得混乱?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">例如?/span></p><blockquote style="box-sizing: border-box; padding: 20px; margin: 0px 0px 25px; font-size: 16px; border-left-width: 6px; border-left-color: #b4b4b4; background-color: #f7f7f7; line-height: 30px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; word-break: break-word !important;"><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">ByteBuffer buffer = ByteBuffer.allocate(48);</p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">intbytesRead = inChannel.read(buffer);</p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">while(! bufferFull(bytesRead) ) {</p><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">    bytesRead = inChannel.read(buffer);</p><p style="box-sizing: border-box; margin: 0px; line-height: 1.7; word-break: break-word !important;">}</p></blockquote><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">bufferFull()方法必须跟踪读入缓冲区的数据量,并返回true或false,具体取决于缓冲区是否已满。换句话说,如果缓冲区已准备好进行处理,则认为它已满?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">bufferFull()方法扫描缓冲区,但必须使缓冲区保持与调用bufferFull()方法之前相同的状态。如果不是,则可能无法在正确的位置读入读入缓冲区的下一个数据。这不是不可能的,但这是另一个需要注意的问题?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">如果缓冲区已满,则可以对其进行处理。如果它不满,您可能能够部分处理那里的任何数据,如果这在您的特定情况下是有意义的。在许多情况下,它没有?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">这个图中说明了is-data-in-buffer-ready循环?/span></p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px; text-align: center; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="box-sizing: border-box; position: relative; z-index: 100; background-color: transparent; transition: background-color 0.1s linear 0s; margin: 0px auto; max-width: 421px; max-height: 297px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 297px;"></div><div data-width="421" data-height="297" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 421px; height: 297px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/1500839-3abb8d1933581759.jpg" src="//upload-images.jianshu.io/upload_images/1500839-3abb8d1933581759.jpg" data-original-width="421" data-original-height="297" data-original-format="image/jpeg" data-original-filesize="15497" style="box-sizing: border-box; border: 0px; vertical-align: middle; transition: all 0.15s linear 0s; z-index: 100; opacity: 1; max-width: 100%; height: auto; cursor: zoom-in; display: block; filter: blur(0px);" alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">▲ Java NIO:从通道读取数据,直到所有需要的数据都在缓冲区中</p><h1 class="bld">6、什么时候该用NIO?什么时候该用经典IO?/h1><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">NIO允许您仅使用一个(或几个)线程来管理多个通道(网络连接或文件),但成本是解析数据可能比从阻塞流中读取数据时更复杂?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">如果您需要同时管理数千个打开的连接,每个只发送一些数据,例如聊天服务器,在NIO中实现服务器可能是一个优势。同样,如果您需要与其他计算机保持大量开放连接,例如在P2P网络中,使用单个线程来管理所有出站连接可能是一个优势?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">此图中说明了这一个线程,多个连接设计?/span></p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px; text-align: center; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="box-sizing: border-box; position: relative; z-index: 100; background-color: transparent; transition: background-color 0.1s linear 0s; margin: 0px auto; max-width: 293px; max-height: 252px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 252px;"></div><div data-width="293" data-height="252" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 293px; height: 252px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/1500839-e4fae4fb9dbb5896.jpg" src="//upload-images.jianshu.io/upload_images/1500839-e4fae4fb9dbb5896.jpg" data-original-width="293" data-original-height="252" data-original-format="image/jpeg" data-original-filesize="11133" style="box-sizing: border-box; border: 0px; vertical-align: middle; transition: all 0.15s linear 0s; z-index: 100; opacity: 1; max-width: 100%; height: auto; cursor: zoom-in; display: block; filter: blur(0px);" alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">▲ Java NIO:管理多个连接的单个线程</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">如果您拥有较少带宽的连接,一次发送大量数据,那么可能最经典的IO服务器实现可能是最合适的?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">此图说明了经典的IO服务器设计:</span></p><div style="box-sizing: border-box; padding-bottom: 25px; width: 700px; margin-left: -40px; text-align: center; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff;"><div style="box-sizing: border-box; position: relative; z-index: 100; background-color: transparent; transition: background-color 0.1s linear 0s; margin: 0px auto; max-width: 500px; max-height: 235px;"><div style="box-sizing: border-box; z-index: 50; padding-bottom: 235px;"></div><div data-width="500" data-height="235" style="box-sizing: border-box; position: absolute; top: 0px; left: 0px; width: 500px; height: 235px; overflow: hidden;"><img data-original-src="//upload-images.jianshu.io/upload_images/1500839-230f65397a072783.jpg" src="//upload-images.jianshu.io/upload_images/1500839-230f65397a072783.jpg" data-original-width="500" data-original-height="235" data-original-format="image/jpeg" data-original-filesize="18859" style="box-sizing: border-box; border: 0px; vertical-align: middle; transition: all 0.15s linear 0s; z-index: 100; opacity: 1; max-width: 100%; height: auto; cursor: zoom-in; display: block; filter: blur(0px);" alt="" /></div></div></div><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">▲ Java IO:经典的IO服务器设?- 由一个线程处理的一个连?/p><h1 class="bld">7、更简化的理解</h1><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">以众所周之的数据读取过程为例,我们来一个更简化的理解?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">对于数据读取,就读取速度来说:CPU > 内存 > 硬盘?/p><blockquote style="box-sizing: border-box; padding: 20px; margin: 0px 0px 25px; font-size: 16px; border-left-width: 6px; border-left-color: #b4b4b4; background-color: #f7f7f7; line-height: 30px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; word-break: break-word !important;"><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;">I- 就是从硬盘到内存</p><p style="box-sizing: border-box; margin: 0px; line-height: 1.7; word-break: break-word !important;">O- 就是从内存到硬盘</p></blockquote><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">第一种方式:</span>从硬盘读取数据,然后程序一直等,数据读完后,继续你的操作。这种方式是最简单的,叫阻塞IO(也就是经典IO)?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="box-sizing: border-box; font-weight: 700;">第二种方式:</span>从硬盘读取数据,然后程序继续向下执行,等数据读取完后,通知当前程序读取完成(对硬件来说叫中断,对程序来说叫回调),然后此程序可以立即处理读取的数据,也可以执行完当前操作后再对读取完的数据进行操作?/p><h1 class="bld">8、总而言?/h1><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">还是以数据读取为例,操作系统是按块Block(块)从硬盘拿数据,就如同一个大脸盆,一下子就放入了一盆水。但是,?Java 使用的时候,旧的 IO(经典IO)确实基??Stream的,也就是虽然操作系统给我了一脸盆水,但是我得用吸管慢慢喝?/p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;">由于经典IO的重重落后理念,于是,NIO 横空出世。。?/p><h1 class="bld">附录:更多NIO异步网络编程资料</h1><blockquote style="box-sizing: border-box; padding: 20px; margin: 0px 0px 25px; font-size: 16px; border-left-width: 6px; border-left-color: #b4b4b4; background-color: #f7f7f7; line-height: 30px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; word-break: break-word !important;"><p style="box-sizing: border-box; margin: 0px 0px 25px; line-height: 1.7; word-break: break-word !important;"></p><table cellspacing="0" cellpadding="0" style="overflow-wrap: break-word; empty-cells: show; border-collapse: collapse; table-layout: fixed; width: 944px; color: #2f2f2f; font-family: "Helvetica Neue", Helvetica, Verdana, sans-serif, "Microsoft Yahei"; font-size: 12px; background-color: #ffffff;"><tbody style="overflow-wrap: break-word;"><tr style="overflow-wrap: break-word;"><td id="postmessage_13006" style="overflow-wrap: break-word; font-size: 15px;">?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">Java新一代网络编程模型AIO原理及Linux系统AIO介绍</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">有关“为何选择Netty”?1个疑问及解答</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">开源NIO框架八卦——到底是先有MINA还是先有Netty?</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">选Netty还是Mina:深入研究与对比(一?/a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">选Netty还是Mina:深入研究与对比(二?/a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">NIO框架入门(一):服务端基于Netty4的UDP双向通信Demo演示</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">NIO框架入门(?:服务端基于MINA2的UDP双向通信Demo演示</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">NIO框架入门(?:iOS与MINA2、Netty4的跨平台UDP双向通信实战</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">NIO框架入门(?:Android与MINA2、Netty4的跨平台UDP双向通信实战</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">Netty 4.x学习(一):ByteBuf详解</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">Netty 4.x学习(二):Channel和Pipeline详解</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">Netty 4.x学习(三):线程模型详解</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">Apache Mina框架高级篇(一):IoFilter详解</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">Apache Mina框架高级篇(二):IoHandler详解</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">MINA2 线程原理总结(含简单测试实例)</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">Apache MINA2.0 开发指南(中文版)[附件下载]</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">MINA、Netty的源代码(在线阅读版)已整理发布</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">解决MINA数据传输中TCP的粘包、缺包问题(有源码)</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">解决Mina中多个同类型Filter实例共存的问?/a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">实践总结:Netty3.x升级Netty4.x遇到的那些坑(线程篇?/a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">实践总结:Netty3.x VS Netty4.x的线程模?/a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">详解Netty的安全性:原理介绍、代码演示(上篇?/a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">详解Netty的安全性:原理介绍、代码演示(下篇?/a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">详解Netty的优雅退出机制和原理</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">NIO框架详解:Netty的高性能之道</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">Twitter:如何使用Netty 4来减少JVM的GC开销(译文)</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">绝对干货:基于Netty实现海量接入的推送服务技术要?/a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">Netty干货分享:京东京麦的生产级TCP网关技术实践总结</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">新手入门:目前为止最透彻的的Netty高性能原理和框架架构解?/a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">写给初学者:Java高性能NIO框架Netty的学习方法和进阶策略</a>?br style="overflow-wrap: break-word;" />?a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">少啰嗦!一分钟带你读懂Java的NIO和经典IO的区?/a>?br style="overflow-wrap: break-word;" />>> <a target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">更多同类文章 ……</a></td></tr><tr style="overflow-wrap: break-word;"><td style="overflow-wrap: break-word;"></td></tr></tbody></table><p style="box-sizing: border-box; margin: 0px; line-height: 1.7; word-break: break-word !important;"><a target="_blank" style="box-sizing: border-box; background-color: transparent; color: #3194d0; text-decoration-line: none; cursor: pointer;"></a></p></blockquote><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #2f2f2f; font-family: -apple-system, "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; font-size: 16px; background-color: #ffffff; word-break: break-word !important;"><span style="color: #000000; font-family: "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px;">(本文同步发布于?/span><a target="_blank" data-mce- style="font-family: "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px;">//www.52im.net/thread-2635-1-1.html</a><span style="color: #000000; font-family: "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px;">?/span></p><img src ="//www.scdqe.tw/jb2011/aggbug/433956.html" width = "1" height = "1" /><br><br><div align=right><a href="//www.scdqe.tw/" title="2017ϹƱ̳ͼ">2017ϹƱ̳ͼ</a> 2019-06-25 16:32 <a href="//www.scdqe.tw/jb2011/archive/2019/06/25/433956.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <script>(function(){ var src = (document.location.protocol == "") ? "//js.passport.qihucdn.com/11.0.1.js?9ed1f3a8f9c3ff069b7b95c01474c743":"https://jspassport.ssl.qhimg.com/11.0.1.js?9ed1f3a8f9c3ff069b7b95c01474c743"; document.write('<script src="' + src + '" id="sozz"><\/script>'); })(); </script>