Java Reference
In-Depth Information
Paired streams - At first glance, these streams might appear to be Decorators, since they have the ability to be
attached to another stream. However, the classes are actually designed to work in complementary pairs— the
output of one feeds the input of another. You can think of these classes as base I/O classes; they can be decorated
themselves, but their true function is to establish a communication channel to another stream.
PipedWriterFilter streams - The filter streams use the Decorator pattern to support chaining. The filter
classes use the following rules to manage decorator behavior:
A filter decorates a class using a constructor that accepts one of the four base I/O classes: InputStream ,
OutputStream , Reader , or Writer .
The filter class usually decorates classes of the same type. This means that an InputStream that is also a filter
will decorate another InputStream , for example. The important exceptions to this rule are the
InputStreamReader and OutputStreamWriter , which translate between bytes and characters.
Search WWH ::




Custom Search