It 18 Palm Palm 13th day Course Summary

Source: Internet
Author: User

Finish the 13th day of it 18 Palm Java Foundation Course today:


Learning content:


HashMap

HashSet

EntrySet ()

|--getkey ()

|--getvalue ()

KeySet ()

|--get (Key)


----------

Performance evaluation with or without buffer


The principle of the buffer is to write the characters into an array and then write the files in bulk, avoiding frequent access to the physical files and increasing efficiency.




Row delimiters can be obtained by means of the method in Java.

The system property name is Line.separator.

The row separators for different platforms are different.

windows7:\r\n

MacOS: \ n

--------------------------------

System.getproperty ("Line.separator"); Execute system Property name/



FileWriter: No buffer function,

---------------------------

itself does not add any functionality to the inherited OutputStreamWriter.

Write () {

Write the data directly to the file.

Sun.nio.cs.StreamEncoder.write (...);

}



BufferedWriter:

----------------------------------

The writer is wrapped, which defines a buffer, which provides writing to a single character, char[], and a string method.

Improve write efficiency.


Hierarchy tree structure: Object-------BufferedWriter

Flushbuffer (): Clears the buffer and writes the buffer data to the destination.

Close () method: Contains Flushbuffer ().



FileReader

-----------------

Inheritance tree: Object--InputStreamReader----FileReader

Read () {

Inputstreamreader.read () {

Sun.nio.cs.StreamDecoder.read ();

}

}



BufferedReader

------------------

Inheritance tree: Object--BufferedReader----LineNumberReader

Read () {

char[] Cbuf = ...;

CBUF[XXX] = c;

Fill ();

return C;

}

Avoid frequent access to physical files.


byte[] bytes = new byte[1023][1024][1024];

byte[] B2 = bytes;

.

.

.

.

bytes = NULL;



Flush ()//cleanup

Refresh ()//refreshing

Clear ()//clear



OutputStream: Output stream

------------------------



Metadata: Metadata that describes the data.

-----------------------------------




Problems encountered:


The wide range of IO streams requires familiarity with



Questions that need help


This article from "Rookie Achievement Data Road" blog, reproduced please contact the author!

It 18 Palm Palm 13th day Course 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.