??xml version="1.0" encoding="utf-8" standalone="yes"?>云南11选5官网http://www.cxosbg.tw/专注于Java技?/description>zh-cnTue, 02 Jul 2019 17:28:40 GMTTue, 02 Jul 2019 17:28:40 GMT60史上最强Java NIO入门Q担心从入门到放弃的Q请读这!http://www.cxosbg.tw/jb2011/archive/2019/06/29/434008.htmlJack JiangJack JiangSat, 29 Jun 2019 14:17:00 GMThttp://www.cxosbg.tw/jb2011/archive/2019/06/29/434008.htmlhttp://www.cxosbg.tw/jb2011/comments/434008.htmlhttp://www.cxosbg.tw/jb2011/archive/2019/06/29/434008.html#Feedback0http://www.cxosbg.tw/jb2011/comments/commentRss/434008.htmlhttp://www.cxosbg.tw/jb2011/services/trackbacks/434008.html阅读全文

Jack Jiang 2019-06-29 22:17 发表评论
]]>
啰嗦!一分钟带你LJava的NIO和经典IO的区?/title><link>http://www.cxosbg.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>http://www.cxosbg.tw/jb2011/archive/2019/06/25/433956.html</guid><wfw:comment>http://www.cxosbg.tw/jb2011/comments/433956.html</wfw:comment><comments>http://www.cxosbg.tw/jb2011/archive/2019/06/25/433956.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cxosbg.tw/jb2011/comments/commentRss/433956.html</wfw:commentRss><trackback:ping>http://www.cxosbg.tw/jb2011/services/trackbacks/433956.html</trackback:ping><description><![CDATA[<h1>1、引a</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;">很多初涉|络~程的程序员Q在研究Java NIOQ即异步IOQ和l典IOQ也是常说的阻塞式IOQ的APIӞ很快׃发现一个问题:我什么时候应该用经典IOQ什么时候应该用NIOQ?/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;">在本文中Q将试用简明扼要的文字Q阐明Java NIO和经典IO之间的差异、典型用例,以及q些差异如何影响我们的网l编E或数据传输代码的设计和实现的?/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;">本文没有复杂理论Q也没有像网上基它文章一样千一律的复制_脓Q有的只是接地气的通俗易懂Q希望能l你带来帮助?/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;">Q本文同步发布于Q?/span><a href="http://www.52im.net/thread-2635-1-1.html" target="_blank" data-mce-href="http://www.52im.net/thread-2635-1-1.html" style="font-family: "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px;">http://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;">Q?/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="http://upload-images.jianshu.io/upload_images/1500839-ebba96b917fb0245.jpeg" src="http://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>2、相x?/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 href="http://www.52im.net/thread-306-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">JavaC代网l编E模型AIO原理及Linuxpȝ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 href="http://www.52im.net/thread-1244-1-1.html" 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>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="http://upload-images.jianshu.io/upload_images/1500839-ee0a0dbe7ba00d41.jpg" src="http://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是面向缓冲区的。那么,q意味着什么?</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意味着您可以从中一ơ读取一个或多个字节。你对读取的字节做什么取决于你。它们不会缓存在M地方。此外,您无法在中的数据中前后Ud。如果需要在从流中读取的数据中前后移动,则需要先其~存在缓冲区中?/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的面向缓冲区的方法略有不同。数据被d~冲区,E后处理该缓冲区。你可以Ҏ需要在~冲Z前后Ud。这使你在处理过E中h更大的灵zL。但是,你还需要检查缓冲区是否包含完整处理所需的所有数据。ƈ且,你需要确保在更多数据读入缓冲区Ӟ不要覆盖未处理的缓冲区中的数据?/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的各U流都是blocking的。这意味着Q当U程调用readQ)或writeQ)Ӟ该线E将被阻塞,直到有一些数据要dQ或者数据被完全写入Q在此期_该线E无法执行Q何其他操作?/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的非d模式允许U程h从通道d数据Qƈ且只获取当前可用的内容,或者根本没有数据,如果当前没有数据可用。线E可以l用其他内容,而不是在数据可供d之前保持d状态?/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;">非阻塞写入也是如此,U程可以h某些数据写入通道Q但不要{待它完全写入。然后线E可以lƈ在同一旉做其他事情?/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;">U程在IO调用中没有阻塞时pI闲旉Q通常在此期间在其他通道上执行IO。也是_单个U程现在可以理多个输入和输出通道?/p><h1>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的选择器允许单个线E监视多个输入通道。你可以使用选择器注册多个通道Q然后用单个线E?#8220;选择”h可用于处理的输入的通道Q或者选择准备写入的通道。这U选择器机制单个U程可以L理多个通道?/p><h1>5、NIO和经典IO如何影响应用E序的设计?</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工具包可能会影响应用E序设计的以下方?</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;">1QAPI调用NIO或IOc;</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;">2Q处理数据;</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;">3Q用于处理数据的U程数?/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;">当然Q用NIO时的API调用看v来与使用IO时不同。这q不奇怪。而不是仅仅从例如InputStreamd字节的数据字节,必须首先数据读入缓冲区Q然后从那里q行处理?/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;">使用UNIO设计与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;">例如Q?/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;">q个文本行流可以像这样处理:</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;">注意处理状态是如何Q由E序执行的程度决定的。换句话_一旦第一个reader.readLineQ)Ҏq回Q您q定已l读取了整行文本。readLineQ)会阻塞直到读取整行,q就是原因。您q知道此行包含名U。同P当第二个readLineQ)调用q回Ӟ您知道此行包含年龄等?/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;">正如您所看到的,只有当有新数据要dӞE序才会q行Qƈ且对于每个步骤,您都知道该数据是什么。一旦执行的U程已经过d代码中的某个数据片段Q该U程׃会在数据中向后移动(通常不会Q?/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;">此图中还说明了此原则Q?/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="http://upload-images.jianshu.io/upload_images/1500839-ccb5dfcd37ebdb45.jpg" src="http://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 IOQ从d中d数据</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的实现看h会有所不同Q这是一个简化的例子Q?/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;">注意W二行从通道d字节到ByteBuffer。当该方法调用返回时Q您不知道所需的所有数据是否都在缓冲区内。你只知道缓冲区包含一些字节,q得处理更加困难?/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;">惌一下,在第一ơ读取(~冲Q调用之后,是否所有读入缓冲区的内定w是半行。例如,“姓名QAn”。你能处理这些数据吗Qƈ不是的。在完成M数据的处理之前,您需要等待至一整行数据q入~冲区?/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;">那么你怎么知道~冲区是否包含够的数据来处理它Q好吧,你没有。找出的唯一Ҏ是查看缓冲区中的数据。结果是Q在您知道所有数据是否存在之前,您可能需要多ơ检查缓冲区中的数据。这既低效又可能在程序设计方面变得؜乱?/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;">例如Q?/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;">bufferFullQ)Ҏ必须跟踪d~冲区的数据量,q返回true或falseQ具体取决于~冲区是否已满。换句话_如果~冲区已准备好进行处理,则认为它已满?/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;">bufferFullQ)Ҏ扫描~冲区,但必Mɾ~冲Z持与调用bufferFullQ)Ҏ之前相同的状态。如果不是,则可能无法在正确的位|读入读入缓冲区的下一个数据。这不是不可能的Q但q是另一个需要注意的问题?/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;">如果~冲区已满,则可以对其进行处理。如果它不满Q您可能能够部分处理那里的Q何数据,如果q在您的特定情况下是有意义的。在许多情况下,它没有?/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;">q个图中说明了is-data-in-buffer-ready循环Q?/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="http://upload-images.jianshu.io/upload_images/1500839-3abb8d1933581759.jpg" src="http://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 NIOQ从通道d数据Q直到所有需要的数据都在~冲Z</p><h1>6、什么时候该用NIOQ什么时候该用经典IOQ?/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允许您仅使用一个(或几个)U程来管理多个通道Q网l连接或文gQ,但成本是解析数据可能比从d中d数据时更复杂?/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中实现服务器可能是一个优ѝ同P如果您需要与其他计算Z持大量开放连接,例如在P2P|络中,使用单个U程来管理所有出站连接可能是一个优ѝ?/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;">此图中说明了q一个线E,多个q接设计Q?/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="http://upload-images.jianshu.io/upload_images/1500839-e4fae4fb9dbb5896.jpg" src="http://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 NIOQ管理多个连接的单个U程</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;">如果您拥有较带宽的q接Q一ơ发送大量数据,那么可能最l典的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="http://upload-images.jianshu.io/upload_images/1500839-230f65397a072783.jpg" src="http://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 IOQ经典的IO服务器设?- ׃个线E处理的一个连?/p><h1>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;">以众所周之的数据读取过Eؓ例,我们来一个更化的理解?/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;">对于数据dQ就d速度来说QCPU > 内存 > 盘?/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;">W一U方式:</span>从硬盘读取数据,然后E序一直等Q数据读完后Ql你的操作。这U方式是最单的Q叫dIOQ也是l典IOQ?/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;">W二U方式:</span>从硬盘读取数据,然后E序l箋向下执行Q等数据d完后Q通知当前E序d完成Q对g来说叫中断,对程序来说叫回调Q,然后此程序可以立卛_理读取的数据Q也可以执行完当前操作后再对d完的数据q行操作?/p><h1>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;">q是以数据读取ؓ例,操作pȝ是按块BlockQ块Q从盘拿数据,如同一个大脸盆Q一下子放入了一盆水。但是,?Java 使用的时候,旧的 IOQ经典IOQ确实基??Stream的,也就是虽然操作系l给我了一脸盆_但是我得用吸慢慢喝?/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;">׃l典IO的重重落后理念,于是QNIO 横空Z。。?/p><h1>附录Q更多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 href="http://www.52im.net/thread-306-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">JavaC代网l编E模型AIO原理及LinuxpȝAIO介绍</a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-163-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">有关“Z选择Netty”?1个疑问及解答</a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-153-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">开源NIO框架八卦——到底是先有MINAq是先有Netty?</a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-96-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">选Nettyq是MinaQ深入研I与ҎQ一Q?/a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-101-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">选Nettyq是MinaQ深入研I与ҎQ二Q?/a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-367-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">NIO框架入门(一)Q服务端ZNetty4的UDP双向通信Demo演示</a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-373-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">NIO框架入门(?Q服务端ZMINA2的UDP双向通信Demo演示</a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-378-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">NIO框架入门(?QiOS与MINA2、Netty4的跨q_UDP双向通信实战</a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-388-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">NIO框架入门(?QAndroid与MINA2、Netty4的跨q_UDP双向通信实战</a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-99-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">Netty 4.x学习Q一Q:ByteBuf详解</a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-100-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">Netty 4.x学习Q二Q:Channel和Pipeline详解</a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-98-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">Netty 4.x学习Q三Q:U程模型详解</a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-109-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">Apache Mina框架高񔽋(一Q:IoFilter详解</a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-110-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">Apache Mina框架高񔽋(二)QIoHandler详解</a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-95-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">MINA2 U程原理ȝQ含单测试实例)</a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-108-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">Apache MINA2.0 开发指南(中文版)[附g下蝲]</a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-113-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">MINA、Netty的源代码Q在UKȝQ已整理发布</a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-111-1-1.html" 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 href="http://www.52im.net/thread-114-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">解决Mina中多个同cdFilter实例共存的问?/a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-181-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">实践ȝQNetty3.x升Netty4.x遇到的那些坑Q线E篇Q?/a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-184-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">实践ȝQNetty3.x VS Netty4.x的线E模?/a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-426-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">详解Netty的安全性:原理介绍、代码演C(上篇Q?/a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-427-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">详解Netty的安全性:原理介绍、代码演C(下篇Q?/a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-348-1-1.html" 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 href="http://www.52im.net/thread-400-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">NIO框架详解QNetty的高性能之道</a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-97-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">TwitterQ如何用Netty 4来减JVM的GC开销Q译文)</a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-166-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">l对q货Q基于Netty实现量接入的推送服务技术要?/a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-1243-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">Nettyq货分nQ京东京麦的生UTCP|关技术实跉|ȝ</a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-2043-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">新手入门Q目前ؓ止最透彻的的Netty高性能原理和框架架构解?/a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-2190-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">写给初学者:Java高性能NIO框架Netty的学习方法和q阶{略</a>?br style="overflow-wrap: break-word;" />?a href="http://www.52im.net/thread-2635-1-1.html" target="_blank" style="overflow-wrap: break-word; color: #0078b6; text-decoration-line: none; transition: all 0.3s ease 0s;">啰嗦!一分钟带你LJava的NIO和经典IO的区?/a>?br style="overflow-wrap: break-word;" />>> <a href="http://www.52im.net/forum.php?mod=collection&action=view&ctid=9" 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 href="https://links.jianshu.com/go?to=http%3A%2F%2Fwww.52im.net%2Fforum.php%3Fmod%3Dcollection%26action%3Dview%26ctid%3D9" 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;">Q本文同步发布于Q?/span><a href="http://www.52im.net/thread-2635-1-1.html" target="_blank" data-mce-href="http://www.52im.net/thread-2635-1-1.html" style="font-family: "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px;">http://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;">Q?/span></p><img src ="http://www.cxosbg.tw/jb2011/aggbug/433956.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cxosbg.tw/jb2011/" target="_blank">Jack Jiang</a> 2019-06-25 16:32 <a href="http://www.cxosbg.tw/jb2011/archive/2019/06/25/433956.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <a href="http://www.cxosbg.tw/"><span class="STYLE1">11ѡ5</span></a> <script>(function(){ var src = (document.location.protocol == "http:") ? "http://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> <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>