|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
org.dellroad.stuff.io.OutputStreamWriter
public class OutputStreamWriter
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.
InputStreamReader| Field Summary |
|---|
| Fields inherited from class java.io.FilterOutputStream |
|---|
out |
| Constructor Summary | |
|---|---|
OutputStreamWriter(OutputStream output)
Constructor. |
|
| Method Summary | |
|---|---|
void |
close()
Close this instance. |
void |
start()
Start a new OutputStream. |
void |
stop()
End the current OutputStream. |
void |
write(int ch)
|
| Methods inherited from class java.io.FilterOutputStream |
|---|
flush, write, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OutputStreamWriter(OutputStream output)
output - the underlying OutputStream that will carry nested OutputStreams within it| Method Detail |
|---|
public void start()
throws IOException
OutputStream.
IOException - if this instance is closed
IOException - if an OutputStream is already started
public void stop()
throws IOException
OutputStream. This flushes the underlying output.
A new OutputStream will be created upon the next invocation of start().
IOException - if this instance is closed
IOException - if no OutputStream is currently started
IOException - if the underlying OutputStream throws an exception
public void close()
throws IOException
OutputStream is already started when this method is invoked, it will be implicitly
stopped.
This ends the current OutputStream and closes the underlying input.
close in interface Closeableclose in class FilterOutputStreamIOException - if an there is an error closing the underlying OutputStream
public void write(int ch)
throws IOException
write in class FilterOutputStreamIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||