java.lang.Object
java.io.OutputStream
com.aoapps.hodgepodge.io.PrintStreamOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Wraps a PrintStream to be an OutputStream. Although PrintStream subclasses
OutputStream, it handles errors differently. This calls checkError after
every write to properly detect and throw exceptions as expected for
an OutputStream. Because checkError is documented as flushing the stream
this may have an adverse affect on performance.
- Author:
- AO Industries, Inc.
-
Constructor Summary
-
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
PrintStreamOutputStream
-
-
Method Details
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-