08 IO stream (V) - file character stream FileWriter / FileReader

Comparative advantage byte stream file

For data transmission of text files, use the file character stream, we do not consider encoding transcoding.

Compare byte stream file, a different process in which

There are character stream file append method:

  1. Writer append(char c)
  2. Writer append (charSequence csq) Note: charSequence sequence of characters, readable and writable, String content can not be defined once, "abc" is a sequence of characters.
  3. Writer append (charSequence csq, int start, int end) starts from the start to the end of the character sequence csq at the start.

File character stream writer has a new method:

  1. void writer(String str)
  2. void writer(String str,int off,int len)

other

When a file character stream copy non-text files, and can copy successful, but will result in file corruption.

Guess you like

Origin www.cnblogs.com/scopicat/p/11914888.html