Java-io Flow Summary

Source: Internet
Author: User

1: More commonly used streams
Fileinputstream,fileoutputstream,filereader,filewriter
Bufferedreader,bufferedwriter.
Inputstreamreader,outputstreamwriter
Node flow: Directly related to a data source or destination.
Process Flow: The construction method must have a node stream.
Buffer stream: A stream with a buffer, such as a buffered word.
All replicated standards are programs.
2: Other Streams
2.1; Printstream,printwriter Print Flow
Print a byte stream, printing a stream of characters.
The difference between print () and the Write () method
For example, to print an integer, print prints 4 bytes, but write writes only the last byte.
3:properties class
MAP--->hashtable------>properties class
This class is primarily used for writing configuration files. And the keys and values inside the set are string types. (Init,)
4:randomaccessfile class Random read-write class.
Seek () position, readable and writable, and operate a regular file. The purpose of random reading is achieved.
5;datainputstream,dataoutputstream operation of basic data type data.

6: Object flow ; Objectinputstream,objectoutputstream, which is used to manipulate objects.
In the program, an object is created, but when the program terminates, the garbage collector reclaims the space. This object cannot be found. Then other programs will not be able to use this object, how to persist the object persisted. You can use object flow to write objects to a file.
7: The Memory stream (which is actually the array stream.) ByteArray chararrays
Because arrays are allocated in memory, they are also called memory streams.
This stream does not produce a IOException exception and is not closed.
The Bytearrayinputstream constructor method needs to accept an array.
Bytearrayoutputstream constructor method because it is written into memory, you do not have to write parameters. If you want to get the data written, you can call the ToString () and Tobytearray () methods.

byte stream : Fileinputstream,fileoutputstream.inputstreamreader,
Objectinputstream,bytearrayinputstream
character Stream : Filereader,filewriter,bufferedreader,bufferedwriter,printwriter, Objectoutputstream.byteoutputstream,outputstreamwriter.
file classes: Files
Streaming Device : keyboard, HDD, memory, console.

Java-io Flow Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.