Chapter 20. The I/O Package
Java平台包含了很多包用来处理数据读入读出。这些包的用途各不相同。
java.io包将I/O视为"流"。 流就是有输入源和输出源的数据序列。这些I/O将程序员从底层的操作系统的的具体细节中解放出来,这样程序员就可以很轻松地通过文件或其他手段获得系统资源。多数的流(比如处理文件的)都支持某些基本接口和抽象类的方法。所有学习这些I/O包的方法先从基本接口和抽象类开始。
java.nio包和其子包将I/O视为"缓冲区"和"通道"。缓冲区用来保存数据(类似数组),可以用来读取或写入数据。"通道"代表的是具有执行I/O操作能力的个体之间的通信,这些个体包括:缓冲区、文件和套接字。nio中的n通常为认为代表"new"(其实这个包早于基于流的"io"包)。n其实是代表"不堵塞",因为基于通道的I/O和基于流的I/O一个关键的不同就是"通道"支持不堵塞的I/O操作,当然也支持堵塞的I/O操作。这种特性在在设计高吞吐的服务端程序的时候非常重要。
java.net包针对网络I/O提供了特殊的支持。基于套接字,它提供了基于流和基于通道的模型。
本章主要讲述java.io包的基于流的模型。简述java.nio包的一些功能,但是不堵塞I/Ojava.net的网络I/O是高级话题,超出了本书的范围。
分享到:
相关推荐
Java之父James Gosling写的Java教程,希望对大家有用!
The Java Programming Language.4th.Edition.Aug.2005.pdf
The Java Programming Language.4th.Edition.Aug.2005 欢迎下载
The C++ Programming Language 4th Edition.pdf
C++11 has arrived: thoroughly master it, with the definitive new guide from C++ creator Bjarne Stroustrup, C++ Programming Language, Fourth Edition! The brand-new edition of the worlds most trusted ...
The C++ Programming Language, 4th Edition 1368 pages Publisher: Addison-Wesley Professional; 4 edition (May 19, 2013) Language: English ISBN-10: 0321563840 ISBN-13: 978-0321563842 C++11 has ...
For other references, see "Further Reading" on page 755. <br>This fourth edition provides integrated coverage of the Java programming language as provided by the Java™ 2 Platform Standard Edition...
The Java Programming Language 4th Edition
JAVA四大名著之一,作者Ken Arnold。
Bjarne Stroustrup The C++ Programming Language, 4th Edition.pdf )
C++11 has arrived: thoroughly master it, with the definitive new guide from C++ creator Bjarne Stroustrup, C++ Programming Language, Fourth Edition! The brand-new edition of the world’s most trusted ...
The C++ Programming Language Special 3rd Edition.rar
The C++Programming Language Special 3rd Edition.pdf
Windows System Programming, 4th Edition. Windows System Programming, 4th Edition.
Introduction.to.Java.Programming.6th.Edition.part1 英文版 CHM格式,由于上传文件限制共RAR分了4部分...
不用介绍了吧。学C++的怎么能错过它呢? 英文版,圣经。 [计算机科学经典着作].Addison.Wesley.Bjarne.Stroustrup.The.C++.Programming.Language.Third.Edition.pdf