Java Basics-Day 22nd

Source: Internet
Author: User

Day22:

IO Stream Overall:

Standard input/output stream

Convert stream

InputStreamReader: Byte stream "Data Trend"

OutputStreamWriter: Character Flow byte stream

Print Flow:

PrintStream

PrintWriter

You can manipulate the file directly:

constructor method, whether to accept both file and string type arguments

FileReader FileWriter FileInputStream Fileoutoutstream printstream

PrintWriter:

Construction method

"Access Denied" exception may appear in Read folder

Print () method ~

Serialization: Input An object in the same way as a stream

ObjectInputStream--Object readobject ()

Deserialization: Restoring a Stream object to an object

ObjectOutputStream--void WriteObject (Object obj)

Serialization ID value fixed

A: The object of the class wants to be serialized stream operation, please serialize the interface;

B: Class implements the serializable interface, resolves the Yellow line warning, and the fixed ID value.

Coding issues:

Encoding table: the characters and their corresponding values are saved in a single table

Properties:

Represents a collection of properties that can be loaded from a stream or stored in a stream with a key value of string

No generics, only a collection that can be used in conjunction with IO streams

String getProperties (String key):

String GetProperties (String key,string defaultvalue):

Object setproperties (String key,string value):

Set<string> Stringpropertieyname ():

System Properties

public static Properties GetProperties (): System Property Set

Combination of collection and IO streams:

List () Method: Stores the data key value pairs in the collection in a file

Load () method: reads the data from the file into the collection "The data is the mode of the key-value pair-delimiter"

Store () method

Java Basics-Day 22nd

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.