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
Constructors -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
PrintStreamOutputStream
-
-
Method Details
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
