<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[JUST CODE]]></title><description><![CDATA[Living at Dawn]]></description><link>https://blog.csdn.net/maxichu</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; maxichu]]></copyright><item><title><![CDATA[6.30工作日志——安卓蓝牙2.0学习报告]]></title><link>https://blog.csdn.net/maxichu/article/details/51798710</link><guid>https://blog.csdn.net/maxichu/article/details/51798710</guid><author>maxichu</author><pubDate>Fri, 01 Jul 2016 09:38:16 +0800</pubDate><description><![CDATA[安卓 蓝牙 2.0]]></description><category></category></item><item><title><![CDATA[Java NIO教程（十一）Pipe]]></title><link>https://blog.csdn.net/maxichu/article/details/49827375</link><guid>https://blog.csdn.net/maxichu/article/details/49827375</guid><author>maxichu</author><pubDate>Sat, 14 Nov 2015 00:49:26 +0800</pubDate><description><![CDATA[Java NIO教程（十）Pipe





Java NIO 管道是2个线程之间的单向数据连接。Pipe有一个source通道和一个sink通道。数据会被写到sink通道，从source通道读取。

这里是Pipe原理的图示：





创建管道

通过Pipe.open()方法打开管道。例如：







1

Pipe
 pipe =]]></description><category></category></item><item><title><![CDATA[Java NIO教程（十）DatagramChannel]]></title><link>https://blog.csdn.net/maxichu/article/details/49827337</link><guid>https://blog.csdn.net/maxichu/article/details/49827337</guid><author>maxichu</author><pubDate>Sat, 14 Nov 2015 00:46:47 +0800</pubDate><description><![CDATA[Java NIO教程（九）DatagramChannel





Java NIO中的DatagramChannel是一个能收发UDP包的通道。因为UDP是无连接的网络协议，所以不能像其它通道那样读取和写入。它发送和接收的是数据包。



打开 DatagramChannel

下面是 DatagramChannel 的打开方式：
DatagramChannel cha]]></description><category></category></item><item><title><![CDATA[Java NIO教程（九）ServerSocketChannel]]></title><link>https://blog.csdn.net/maxichu/article/details/49821237</link><guid>https://blog.csdn.net/maxichu/article/details/49821237</guid><author>maxichu</author><pubDate>Fri, 13 Nov 2015 17:50:59 +0800</pubDate><description><![CDATA[Java NIO中的 ServerSocketChannel 是一个可以监听新进来的TCP连接的通道, 就像标准IO中的ServerSocket一样。ServerSocketChannel类在 java.nio.channels包中。





这里有个例子：


ServerSocketChannel serverSocketChannel = ServerSocketChan]]></description><category></category></item><item><title><![CDATA[Java NIO教程（八）SocketChannel]]></title><link>https://blog.csdn.net/maxichu/article/details/49821187</link><guid>https://blog.csdn.net/maxichu/article/details/49821187</guid><author>maxichu</author><pubDate>Fri, 13 Nov 2015 17:45:43 +0800</pubDate><description><![CDATA[Java NIO教程（八）SocketChannel




Java NIO中的SocketChannel是一个连接到TCP网络套接字的通道。可以通过以下2种方式创建SocketChannel：

打开一个SocketChannel并连接到互联网上的某台服务器。一个新连接到达ServerSocketChannel时，会创建一个SocketChannel。



打开 Soc]]></description><category></category></item><item><title><![CDATA[Java NIO教程（七）FileChannel]]></title><link>https://blog.csdn.net/maxichu/article/details/49821087</link><guid>https://blog.csdn.net/maxichu/article/details/49821087</guid><author>maxichu</author><pubDate>Fri, 13 Nov 2015 17:38:46 +0800</pubDate><description><![CDATA[Java
 NIO教程（七）FileChannel


Java NIO中的FileChannel是一个连接到文件的通道。可以通过文件通道读写文件。

FileChannel无法设置为非阻塞模式，它总是运行在阻塞模式下。



打开FileChannel

在使用FileChannel之前，必须先打开它。但是，我们无法直接打开一个FileChannel，需要通过使用一个In]]></description><category></category></item><item><title><![CDATA[Java NIO教程（六）Selector]]></title><link>https://blog.csdn.net/maxichu/article/details/49820831</link><guid>https://blog.csdn.net/maxichu/article/details/49820831</guid><author>maxichu</author><pubDate>Fri, 13 Nov 2015 17:25:09 +0800</pubDate><description><![CDATA[Java NIO教程（六）Selector


Selector（选择器）是Java NIO中能够检测一到多个NIO通道，并能够知晓通道是否为诸如读写事件做好准备的组件。这样，一个单独的线程可以管理多个channel，从而管理多个网络连接。






为什么使用Selector?

仅用单个线程来处理多个Channels的好处是，只需要更少的线程来处理通道。事实上，可以只]]></description><category></category></item><item><title><![CDATA[Java NIO教程（五） 通道之间的数据传输]]></title><link>https://blog.csdn.net/maxichu/article/details/49820143</link><guid>https://blog.csdn.net/maxichu/article/details/49820143</guid><author>maxichu</author><pubDate>Fri, 13 Nov 2015 16:48:51 +0800</pubDate><description><![CDATA[Java NIO教程（五） 通道之间的数据传输




在Java NIO中，如果两个通道中有一个是FileChannel，那你可以直接将数据从一个channel（译者注：channel中文常译作通道）传输到另外一个channel。

transferFrom()

FileChannel的transferFrom()方法可以将数据从源通道传输到FileChannel中（译者注：]]></description><category></category></item><item><title><![CDATA[Java NIO教程（四） Scatter & Gather]]></title><link>https://blog.csdn.net/maxichu/article/details/49819463</link><guid>https://blog.csdn.net/maxichu/article/details/49819463</guid><author>maxichu</author><pubDate>Fri, 13 Nov 2015 16:11:39 +0800</pubDate><description><![CDATA[Java NIO教程（四） Scatter & Gather


Java NIO开始支持scatter/gather，scatter/gather用于描述从Channel（译者注：Channel在中文经常翻译为通道）中读取或者写入到Channel的操作。
分散（scatter）从Channel中读取是指在读操作时将读取的数据写入多个buffer中。因此，Channel将从Channel中]]></description><category></category></item><item><title><![CDATA[Java NIO教程（三） Buffer]]></title><link>https://blog.csdn.net/maxichu/article/details/49819211</link><guid>https://blog.csdn.net/maxichu/article/details/49819211</guid><author>maxichu</author><pubDate>Fri, 13 Nov 2015 15:58:47 +0800</pubDate><description><![CDATA[Java NIO教程（三） Buffer


Java NIO中的Buffer用于和NIO通道进行交互。如你所知，数据是从通道读入缓冲区，从缓冲区写入到通道中的。

缓冲区本质上是一块可以写入数据，然后可以从中读取数据的内存。这块内存被包装成NIO Buffer对象，并提供了一组方法，用来方便的访问该块内存。

下面是NIO Buffer相关的话题列表：

Buffer的基本用法]]></description><category></category></item><item><title><![CDATA[Java NIO教程（二） Channel]]></title><link>https://blog.csdn.net/maxichu/article/details/49819111</link><guid>https://blog.csdn.net/maxichu/article/details/49819111</guid><author>maxichu</author><pubDate>Fri, 13 Nov 2015 15:54:44 +0800</pubDate><description><![CDATA[Java NIO教程（一）  核心概述

Java NIO的通道类似流，但又有些不同：

既可以从通道中读取数据，又可以写数据到通道。但流的读写通常是单向的。通道可以异步地读写。通道中的数据总是要先读到一个Buffer，或者总是要从一个Buffer中写入。

正如上面所说，从通道读取数据到缓冲区，从缓冲区写入数据到通道。如下图所示：





Channel的实现

这]]></description><category></category></item><item><title><![CDATA[Java NIO教程（一）  核心概述]]></title><link>https://blog.csdn.net/maxichu/article/details/49819027</link><guid>https://blog.csdn.net/maxichu/article/details/49819027</guid><author>maxichu</author><pubDate>Fri, 13 Nov 2015 15:51:34 +0800</pubDate><description><![CDATA[http://tutorials.jenkov.com/java-nio/overview.html]]></description><category></category></item><item><title><![CDATA[解题报告 之 HDU 4089 Activation]]></title><link>https://blog.csdn.net/maxichu/article/details/48979681</link><guid>https://blog.csdn.net/maxichu/article/details/48979681</guid><author>maxichu</author><pubDate>Thu, 08 Oct 2015 22:01:15 +0800</pubDate><description><![CDATA[2011北京区域赛现场赛
After 4 years' waiting, the game "Chinese Paladin 5" finally comes out. Tomato is a crazy fan, and luckily he got the first release. Now he is at home, ready to begin his journey. 
But before starting the game, he must first activate the produ]]></description><category></category></item><item><title><![CDATA[解题报告 之 HDU 4405 Aeroplane chess]]></title><link>https://blog.csdn.net/maxichu/article/details/48942209</link><guid>https://blog.csdn.net/maxichu/article/details/48942209</guid><author>maxichu</author><pubDate>Wed, 07 Oct 2015 02:37:57 +0800</pubDate><description><![CDATA[Hzz loves aeroplane chess very much. The chess map contains N+1 grids labeled from 0 to N. Hzz starts at grid 0. For each step he throws a dice(a dice have six faces with equal probability to face up and the numbers on the faces are 1,2,3,4,5,6). When Hzz ]]></description><category></category></item><item><title><![CDATA[解题报告 之 ZOJ 3329 One Person Game]]></title><link>https://blog.csdn.net/maxichu/article/details/48905617</link><guid>https://blog.csdn.net/maxichu/article/details/48905617</guid><author>maxichu</author><pubDate>Mon, 05 Oct 2015 01:01:18 +0800</pubDate><description><![CDATA[There is a very simple and interesting one-person game. You have 3 dice, namely Die1, Die2 and Die3. Die1 has K1 faces. Die2 has K2 faces. Die3 has K3 faces. All the dice are fair dice, so the probability of rolling each value, 1 to K1, K2, K3 is exactly 1]]></description><category></category></item><item><title><![CDATA[解题报告 之 POJ 2096 Collecting Bugs]]></title><link>https://blog.csdn.net/maxichu/article/details/48897313</link><guid>https://blog.csdn.net/maxichu/article/details/48897313</guid><author>maxichu</author><pubDate>Sun, 04 Oct 2015 23:06:18 +0800</pubDate><description><![CDATA[Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material stuff, he collects software bugs. When Ivan gets a new program, he classifies all possible bugs into n categories. Each day he discovers exactly one bug in the]]></description><category></category></item><item><title><![CDATA[解题报告 之 POJ 3744 Scout YYF I]]></title><link>https://blog.csdn.net/maxichu/article/details/48886005</link><guid>https://blog.csdn.net/maxichu/article/details/48886005</guid><author>maxichu</author><pubDate>Sun, 04 Oct 2015 02:08:33 +0800</pubDate><description><![CDATA[YYF is a couragous scout. Now he is on a dangerous mission which is to penetrate into the enemy's base. After overcoming a series difficulties, YYF is now at the start of enemy's famous "mine road". This is a very long road, on which there are numbers of m]]></description><category></category></item><item><title><![CDATA[解题报告 之 ZOJ 3829 Known Notation]]></title><link>https://blog.csdn.net/maxichu/article/details/48845367</link><guid>https://blog.csdn.net/maxichu/article/details/48845367</guid><author>maxichu</author><pubDate>Thu, 01 Oct 2015 11:40:46 +0800</pubDate><description><![CDATA[Do you know reverse Polish notation (RPN)? It is a known notation in the area of mathematics and computer science. It is also known as postfix notation since every operator in an expression follows all of its operands. Bob is a student in Marjar University]]></description><category></category></item><item><title><![CDATA[解题报告 之 ZOJ 3827 Information Entropy]]></title><link>https://blog.csdn.net/maxichu/article/details/48816183</link><guid>https://blog.csdn.net/maxichu/article/details/48816183</guid><author>maxichu</author><pubDate>Wed, 30 Sep 2015 00:44:27 +0800</pubDate><description><![CDATA[解题报告 之 ZOJ 3827 Information Entropy





Description

Information Theory is one of the most popular courses in Marjar University. In this course, there is an important chapter about informatio]]></description><category></category></item><item><title><![CDATA[解题报告 之 ZOJ 3822 Domination]]></title><link>https://blog.csdn.net/maxichu/article/details/48815355</link><guid>https://blog.csdn.net/maxichu/article/details/48815355</guid><author>maxichu</author><pubDate>Wed, 30 Sep 2015 00:36:27 +0800</pubDate><description><![CDATA[Edward is the headmaster of Marjar University. He is enthusiastic about chess and often plays chess with his friends. What's more, he bought a large decorative chessboard with N rows and M columns.
Every day after work, Edward will place a chess piece on a]]></description><category></category></item></channel></rss>