Qianfengday20-java Basic Learning: Data flow, random read file stream randomaccessfile

Source: Internet
Author: User
Tags serialization

Course review:

Flow:
Conversion Flow: Conversion of characters and bytes
Object flow: serialization, deserialization

Print Flow: Print data of various data types


Today's content:
Data stream: Supports writing out the basic data type, byte stream, processing stream
1, DataOutputStream: Data output byte stream
Common methods:
WriteXXX: Write data for a basic data type
writeUTF: Writing out a string
2, DataInputStream: data input byte stream
Common methods:
READXXX: Reading data of the base data type
readUTF: Reading a string


Random read File class: A way to write and read basic data types
Randomaccessfile
Mode:
1, R: Read Only
2. RW: Read and Write
3, RWS: Read and write, and timely refresh the file content and meta-data
4, RWD: Read and write, and timely refresh the contents of the file

Common methods:
Read: reads, bytes
READXXX: Reading basic data types
readUTF: Reading a string
Length: File size
SetLength: Setting File size
Seek: Sets the location of the file pointer (index)
Getfilepointer: Get file pointer
Write: Write, byte
WriteXXX: Write the basic data type
writeUTF: Writing out a string
Close: Off


File class:
Renameto
Delete
List
Listfiles
FilenameFilter

Flow: A conduit for data communication
Flow of data: file, memory, network
Classification of streams:
1. Direction
2. Units
3. function

Common streams:
Node Flow:
1, File Stream (FILEXXX): Manipulate the flow of files, data stored in the file
2. Memory Stream (BYTEARRAYXXX): Flow of operating memory, data stored in memory
Processing Flow:
3. Buffer Stream (BUFFEREDXXX): Improve reading and writing efficiency
4. Conversion stream (character stream): conversion between byte stream and character stream, can specify encoding format------only characters, divided into input, output
5, Object Flow (OBJECTXXX): Serialization and deserialization, support a variety of data types-----Only byte stream, divided into input, output
6. Print Stream (PRINTXXX): Print various data types-------only output, divided into characters and bytes
7, Data stream (DATAXXX): Read and write out the basic data type, string-------only bytes, divided into input, output

8, Random Read file class: Randomaccessfile
Modes: R, RW, RWS, RWD
For reading and writing methods, basic data and strings


Collections: Dynamically Storing multiple objects
1, collection<e>
1, list<e>
1.
2.
2, set<e>
1.
2.
3.
2, map<k,v>
1.
2.
3.

Qianfengday20-java Basic Learning: Data flow, random read file stream randomaccessfile

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.