Java Fundamentals (20) IO Stream (iii)

Source: Internet
Author: User

Here are some of the lessons I summarized in the previous lesson and the code is most of the teacher's notes personally think is very good, but also a more classic content, sincere hope that these for those who want to learn some help!

Because the code is sub-module upload is very inconvenient. Also more, speak of is more clear! If you need to be able to leave your email in the comments I see will be sent to you for free! Thank you for this platform let us all progress together!! Remember that the programmer is selfless!!!

Also very welcome to my blog to watch the blog address: http://www.cnblogs.com/duscl/

/*1: Character stream (Master) (1) Byte 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. (2) Conversion stream is actually a character stream character stream = byte stream + encoding table (3) Encoding Table A: is a table consisting of characters and corresponding values B: Common encoding table ASCII ISO                -8859-1 GB2312 GBK GB18030 UTF-8 C: Encoding problem encoding in strings String--byte[] decoding byte[]--String (4) encoding problem in IO stream a:outputstreamwriter O        Utputstreamwriter (outputstream OS): Default encoding, GBK outputstreamwriter (OutputStream os,string charsetname): Specifies the encoding. B:inputstreamreader InputStreamReader (InputStream is): Default encoding, GBK InputStreamReader (InputStream is,St                Ring charsetname): Specify encoding C: encoding problem is actually very simple coding as long as the same can (5) character Stream Reader |--inputstreamreader |--filereader |--bufferedreader Writer |--outputstreamwriter |--fil Ewriter |--bufferedwriter (6) Copy text file (5 ways) 2:io Flow summary (master) IOStream |--byte stream |--byte input stream inputstream int read (): read one byte at a time NT Read (byte[] bys): reads one byte array at a time |--fileinputstream |--bufferedinputst  Ream |--byte output stream outputstream void write (int by): Write one byte at a time void                    Write (byte[] bys,int index,int len): Writes part of a byte array one at a time |--fileoutputstream |--bufferedoutputstream |--characters Stream |--character input stream reader int read (): read one at a time                        character int read (char[] CHS): reads one character array at a time |--inputstreamreader            |--filereader |--bufferedreader string ReadLine (): reads one string at a time |--character output stream Writer void write (int ch): Write one character at a time void write (char[] C Hs,int index,int len): OnceWrite a part of a character array |--outputstreamwriter |--filewriter |--bufferedwriter void NewLine (): Write a newline character void Write (string line): writes one string at a time 3: case (comprehension exercise once) A: Copy text file 5 ways (Master) B: Copy picture (binary stream data) 4 ways (Master) C: Store the data in the collection into a text file D: The number in the text file Read to set merge Traverse collection E: Copy single-level folder F: Copy the file specified in the single-level folder and modify the name review the bulk modification name G: Copy multilevel folder H: Keyboard entry Student information save from high to low in the text file I: The word in a file Output to another text file after the string is sorted J: simulating the unique function of BufferedReader with reader K: simulating the unique functions of LineNumberReader *\

Java Fundamentals (20) IO Stream (iii)

Related Article

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.