you can chain in/output streams with others using subclasses of FilterIn/OutputStream...
Subclasses of FilterOutputStreams are
BufferedOutputStream, CheckedOutputStream, CipherOutputStream, DataOutputStream, DeflaterOutputStream, DigestOutputStream, PrintStream
Subclasses of FilterInputStreams are
BufferedInputStream, CheckedInputStream, CipherInputStream, DataInputStream, DigestInputStream, InflaterInputStream, LineNumberInputStream, ProgressMonitorInputStream, PushbackInputStream
For instance you can chain streams as follows:
What you have here is a primitive-writable, portable and buffered stream to a file. You achieve stream chaining by using Filter*Stream, i.e. each Filter may add its 2 cents to the reading/writing process. A CipherOutputStream automatically encrypt what is written to it, a ZipOutputStream un/compresses the given contents, etc...
HIH
------------------
Valentin Crettaz
Sun Certified Programmer for
Java 2 Platform
[This message has been edited by Valentin Crettaz (edited November 13, 2001).]