Class OutputStreamWriter

java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.dellroad.stuff.io.OutputStreamWriter
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class OutputStreamWriter extends FilterOutputStream
Serializes zero or more OutputStreams inside a single underlying OutputStream. The results can be deserialized as equally many distinct InputStreams on the other end using an InputStreamReader. Each OutputStream may contain an arbitrary amount of data.

To use this class, invoke start() to start a new OutputStream, write to it by writing to this class normally, and then use stop() to close the current OutputStream. A new, subsequent OutputStream is created by invoking start() again.

Each OutputStream written in this way will be read as distinct InputStream by the InputStreamReader at the other end.

Instances of this class are thread safe.

See Also: