Input and output file streams can be created using FileWriter and FileReader, which attach a standard reader or writer to a file. PrintWriter is used for text output, and must be combined with a writer, as in the example. Declaring a BufferedReader object allows you to create a new buffered input stream that reads characters from the stream (a file in the example) without causing a disk access every time. When the buffer is empty, a new block of data is read into the buffer.