1. NIO
1.1. 说明:在新的I/O系统当中,我们将主要使用Channel和Buffer来描述我们底层的操作。
1.2. 模型:

1.3. 对Channel进行读写:
/**
* @author cenyongh@mails.gscas.ac.cn
*/
public class CopyFile {
public static void main(String[] args) throws Exception {
String in = args[0];
String out = args[1];
FileInputStream fis = new FileInputStream(in);
FileOutputStream fos = new FileOutputStream(out);
FileChannel inc = fis.getChannel();
FileChannel outc = fos.getChannel();
ByteBuffer bb = ByteBuffer.allocate(1024);
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!



