Simple summary of JAVA IO stream + Collect log exception information

Source: Internet
Author: User

1. Byte stream :
Iuputstream the superclass of all byte output streams. Abstract class
----FileInputStream
----Bufferedinputstream: Provides read efficiency of data, extended method (internally maintains an array of 8k bytes)

OutputStream the superclass of all byte output streams. Abstract class
----FileOutputStream
----Bufferedoutputstream: Improve the writing efficiency of data, expand the method (internal maintenance of a 8k byte array)

Writes to disk: 1. Flush () by flush (), 2.close (), 3. The data is already full in the array

2. Character Stream :
Reader: Super class for character input stream
----FileReader
----BufferedReader: Improve the reading efficiency of data, expand the method (internally maintained a character array, size 8,192 characters)

Write: The superclass of the character output stream
----FileWriter
1024 characters are maintained as characters
Writes to disk: 1. Flush () by flush (), 2.close (). 3. Data is already full in the array
----BufferedWriter: Improve the writing efficiency of data, expand the method (internal maintenance of a character array, size 8,192 characters)
3. Sequence Flow:

Sequenceinputstream can concatenate multiple bytes of input streams, and then stream those bytes into one read data.


4. Object input and output stream:

ObjectInputStream

Objectoutputsream

Use note points:
1. Want to read or write objects to disk through the object stream, you need to make the object's owning class implement serializable interface, serializable interface, there is no way to just make a mark
2. When changing the value of a property in a class, you can still read the data and need to set Serialversionuid to a constant: private static final long serialversionuid = 1L;
3. If you do not want to write a property to disk, you can use the transient keyword to decorate

Collecting Exception Log Information

Simple summary of JAVA IO stream + Collect log exception information

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.