Start of Tutorial > Start of Trail > Start of Lesson |
Search
Feedback Form |
Thereverse
method contains some other interesting code; in particular, these two statements:The code opens aBufferedReader in = new BufferedReader(source); ... PrintWriter out = new PrintWriter(pipeOut);BufferedReader
onsource
, which is another reader of a different type. This essentially "wraps"source
in aBufferedReader
. The program reads from theBufferedReader
, which in turn reads fromsource
. The program does this so that it can useBufferedReader
's convenientreadLine
method. Similarly, thePipedWriter
is wrapped in aPrintWriter
so that the program can usePrintWriter
's convenientprintln
method. You will often see streams wrapped in this way so as to combine the various features of the many streams.
Start of Tutorial > Start of Trail > Start of Lesson |
Search
Feedback Form |
Copyright 1995-2004 Sun Microsystems, Inc. All rights reserved.