21st Day of Java Learning

Source: Internet
Author: User

1: Character Stream (master) (1Byte stream operation Chinese data is not particularly convenient, so there is a conversion stream.    The function of the conversion stream is to use the byte stream to convert the character stream. (2the conversion stream is actually a stream of character streams= byte Stream +Encoding Table (3encoding Table A: is a table of characters and corresponding values B: Common encoding table ASCII ISO-8859-1GB2312 GBK GB18030 UTF-8C: Encoding problem encoding string in strings--byte[] Decodingbyte[] --String (4) encoding problem in IO stream a:outputstreamwriter outputstreamwriter (outputstream OS): Default encoding, GBK OutputStream        Writer (OutputStream os,string charsetname): Specifies the encoding. B:inputstreamreader InputStreamReader (InputStream is): Default encoding, GBK InputStreamReader (InputStream Is,Stri ng CharsetName): Specify encoding C: encoding problem is actually very simple coding as long as the same can be (5) Character Stream Reader|--InputStreamReader|--FileReader|--BufferedReader Writer|--OutputStreamWriter|--FileWriter|--BufferedWriter (6) Copy the text file (5 ways)2: IO Stream Summary (master) IO stream|--Byte stream|--byte input stream InputStreamintRead (): read one byte at a timeintReadbyte[] bys): One byte array read at a time|--FileInputStream|--Bufferedinputstream|--byte output stream outputstreamvoidWriteintby ): Write one byte at a timevoidWritebyte[] bys,intIndexintlen): Write one part of a byte array at a time|--FileOutputStream|--Bufferedoutputstream|--character Stream|--character input stream ReaderintRead (): read one character at a timeintReadChar[] CHS): read one character array at a time|--InputStreamReader|--FileReader|--BufferedReader string ReadLine (): reads one string at a time|--character output stream WritervoidWriteintch): Write one character at a timevoidWriteChar[] CHS,intIndexintlen): Write one part of a character array at a time|--OutputStreamWriter|--FileWriter|--BufferedWritervoidnewLine (): Write a line breakvoidWrite (string line): writes one string at a time3: Case (Comprehension exercise) A: Copy text file 5 ways (Master) B: Copy picture (binary stream data) 4 ways (mastering) C: Storing data in a collection into a text file D: Reading data from a text file into a set merge Traverse collection E: Copy a single-level folder F: Copy the file specified in the single-level folder and modify the name review the bulk modification name G: Copy multi-level folder H: Keyboard entry student information from high to low to text file I: Sorting strings in one file and outputting them to another text file J: with R Eader characteristic function of analog BufferedReader K: Unique function of analog LineNumberReader

21st Day of Java Learning

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.