The Java language input and output function is very powerful and flexible, the drawback is that the code that looks like the input and output is not very concise, because you often need to wrap many different objects. In the Java class Library, the IO portion of the content is very large, because it involves a wide range of fields: standard input and output, file operation, data flow on the network, string stream, object flow, zip file stream .... The purpose of this article is to give you a brief introduction.
flow is a very image concept, when the program needs to read the data, it will open a stream to the data source, the data source can be a file, memory, or network connection. Similarly, when a program needs to write data, it opens a stream to the destination. At this point you can imagine that the data is like "flow" in this, such as :
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/8C/A9/wKiom1hzT3-RhnqYAAANdEih2DA739.png "title=" Stream_1.png "alt=" Wkiom1hzt3-rhnqyaaandeih2da739.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/8C/A5/wKioL1hzT3-SL-76AAANpiiZ5pc914.png "title=" steam _2.png "alt=" Wkiol1hzt3-sl-76aaanpiiz5pc914.png "/>
Java The stream is divided into two types, one is a byte stream, the other is a character stream, which is represented by four abstract classes (each stream consists of two inputs and outputs, so altogether four) : InputStream , OutputStream , Reader , Writer . The other varied streams in Java are derived from them :
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/8C/A5/wKioL1hzUMKDVFElAAAlFJv-s6A276.png "title=" Stream_3.png "alt=" Wkiol1hzumkdvfelaaalfjv-s6a276.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/8C/A9/wKiom1hzUMOAFFljAAAYq6Dx7TU522.png "title=" Stream_4.png "alt=" Wkiom1hzumoaffljaaayq6dx7tu522.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/8C/A5/wKioL1hzUMOAXVWFAAAaNsnhvs0214.png "title=" Stream_5.png "alt=" Wkiol1hzumoaxvwfaaaansnhvs0214.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/8C/A9/wKiom1hzUMPR4vAXAAAa2THalWk919.png "title=" Stream_6.png "alt=" Wkiom1hzumpr4vaxaaaa2thalwk919.png "/>
This article is from the "9865854" blog, please be sure to keep this source http://9875854.blog.51cto.com/9865854/1890460
Talking about the input and output stream of Java