在软件系统中,IO速度比内存速度慢,IO读写在很多情况下会是系统的瓶颈。
在java标准IO操作中,InputStream和OutputStream提供基于流的IO操作,以字节为处理单位;Reader和Writer实现了Buffered缓存,以字符为处理单位。
从Java1.4开始,增加NIO(New IO),增加缓存Buffer和通道Channel,以块为处理单位,是双向通道(可读可写,类似RandomAccessFile),支持锁和内存映射文件访问接口,大大提升了IO速度。
以下例子简单测试常见IO操作...
                            
                            
                                分类:
编程语言   时间:
2014-06-07 15:49:03   
                                阅读次数:
283
                             
                    
                        
                            
                            
                                安装phpunitpear channel-discover pear.phpunit.depear 
channel-discover pear.symfony-project.compear channel-discover components.ez.no 
(我新开dos窗口更新多次)pear ...
                            
                            
                                分类:
Web程序   时间:
2014-06-07 10:26:00   
                                阅读次数:
485
                             
                    
                        
                            
                            
                                Bonding:Ethernet Channel Bonding enables two or 
more Network Interfaces Card (NIC) to a single virtual NIC card which may 
increase the bandwidth and p...
                            
                            
                                分类:
Web程序   时间:
2014-06-07 03:38:59   
                                阅读次数:
267
                             
                    
                        
                            
                            
                                传统的I/O速度相对比较慢,它会成为系统性能的瓶颈,所以在java1.4之后提供了NIO,它是一种全新的流:它具有以下特性:
       1.为所有的原是类型提供Buffer缓存支持;
2.使用java.nio.charset.Charset作为字符编码解码解决方案;
3.增加通道(Channel)对象,作为新的原始I/O抽象;
4.支持锁和内存映射文件的文件访问接口;
5.提供基于S...
                            
                            
                                分类:
编程语言   时间:
2014-06-02 12:29:02   
                                阅读次数:
294
                             
                    
                        
                            
                            
                                参考Netty API
io.netty.channel.ChannelPipeline
A list of ChannelHandlers which handles or intercepts inbound events and outbount operations of a
Channel. ChannelPipeline implements an advanced fo...
                            
                            
                                分类:
Web程序   时间:
2014-06-01 15:44:27   
                                阅读次数:
533
                             
                    
                        
                            
                            
                                如何判断当前循环的栏目是不是最后一个href=”[field:typelink>在实际的开发中,使用channel显示顶级栏目的时候可能会遇到这样的情况,第一个栏目和最后一个栏目的样式与中间的栏目的样式不一样,第一个栏目的样式我们可以通过autoindex来设置,而最后一个栏目的样式是不能..
                            
                            
                                分类:
其他好文   时间:
2014-06-01 13:49:45   
                                阅读次数:
384
                             
                    
                        
                            
                            
                                select * from channel where pid=0 union select * 
from channel where pid=1 union select * from channel where pid=3 limit 
5,10这里的limit限制了返回的union(合并)后的结...
                            
                            
                                分类:
其他好文   时间:
2014-05-31 01:47:26   
                                阅读次数:
218
                             
                    
                        
                            
                            
                                channel 不仅能够控制数据传输,还可以控制执行流。1. 
关闭的channel从来都不会阻塞关闭的channel不能传数据但是可以接受数据,例子```package mainimport "fmt"func 
main() { ch := make(chan bool, 2) ...
                            
                            
                                分类:
其他好文   时间:
2014-05-30 00:08:36   
                                阅读次数:
250
                             
                    
                        
                            
                            
                                关键词:netty4 对象 序列化废话少说,直接上代码了Client.javaimport 
io.netty.bootstrap.Bootstrap;import io.netty.channel.*;import 
io.netty.channel.nio.NioEventLoopGroup;imp...
                            
                            
                                分类:
Web程序   时间:
2014-05-22 04:42:16   
                                阅读次数:
644
                             
                    
                        
                            
                            
                                FileChannel是flume一个非常重要的channel组件,非常常用。这个channel非常复杂,涉及的文件更多涉及三个包:org.apache.flume.channel.file、org.apache.flume.channel.file.encryption(加密)、org.apa.....
                            
                            
                                分类:
其他好文   时间:
2014-05-19 13:02:06   
                                阅读次数:
285