Preface:
IO for the system design, is a very important point of concern, often the bottleneck in the system operation in the IO design, whether it is database io, file io or network IO, need to be refined design, in order to make the system to achieve the best running state. For modern system concurrency and data volume explosion, IO processing is more important for the system. Studying Java IO is good for our work.
The java.io contains the Java blocking IO design. Java IO consists of three main parts:
1. The main part of the flow-type part –io;
2. Non-streaming section – a class consisting mainly of some auxiliary flow sections, such as the file class, the Randomaccessfile class, and the FileDescriptor class;
3. The file read section of the security-related classes, such as: Serializablepermission class. and classes of file systems related to the local operating system, such as the FileSystem class and the Win32filesystem class and the Winntfilesystem class.
Java.io packet is mainly a byte stream and character stream, input and output, flow has the most basic features: flow is one, one-way.
The following is a look at the specific class diagrams of most classes in the Java.io package to understand their inheritance relationships.
BYTE input stream:
BYTE output stream:
Character input stream:
BYTE output stream:
From the above-mentioned class diagram, the byte stream and the character stream are mostly implemented in InputStream, OutputStream, Writer, reader interface.
Java.io Series interface and implementation, the use of a large number of decorator design patterns, which allows the class function can be extended without changing the original class structure, and we can also create their own decorators to wrap some specific stream classes.
In the next series, this series will begin with the byte stream, which is analyzed for each stream and the flow of each adornment. This paper analyzes and uses the source code.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
IO Overview of Java io (i)