This chapter discusses Java's FileReader and BufferedReader classes in detail. FileReader and BufferedReader classes are used together when reading data from an external file. The use of the BufferedReader class allows data to be buffered as it is read from a file before manipulating it. The readLine() method of the BufferedReader class reads a line of text from a character-oriented input stream, and puts it into a new String object.
8. Flow Chart of the Program
Answer:
No. Most word processing files use their own format, which is not understood by a Reader
that is expecting UTF
characters. To process a Word file, you would use byte-oriented streams, InputStream
and OutputStream
.
Flow Chart of the Program
The general design of the program is given in the flowchart. Of course, many details are left out. The purpose of the chart is to show the overall logic.
The box "Read a line of source" appears in two places—before the loop gets started and in the body of the loop. Study the logic to see that this is correct.
Question 8:
Will this logic correctly copy an empty file (a file that exists, but returns end-of-file immediately)?