java.lang.Object
java.io.OutputStream
com.aoapps.lang.io.WriterOutputStream
- All Implemented Interfaces:
NoClose
,Closeable
,Flushable
,AutoCloseable
A writer output stream makes a
Writer
behave like an
OutputStream
. No encoding/decoding is performed.- Author:
- AO Industries, Inc.
-
Constructor Summary
ConstructorsConstructorDescriptionWriterOutputStream
(Writer out) Create a new PrintWriter, without automatic line flushing. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Calls to close are ignored whenNoClose.isNoClose()
, otherwise some action might be taken which means close calls to this object may not be skipped or assumed to be ignored.void
flush()
boolean
Determines if calls toNoClose.close()
will be ignored.void
write
(byte[] b, int off, int len) void
write
(int b) Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
Constructor Details
-
WriterOutputStream
Create a new PrintWriter, without automatic line flushing.- Parameters:
out
- A character-output stream
-
-
Method Details
-
isNoClose
public boolean isNoClose()Description copied from interface:NoClose
Determines if calls toNoClose.close()
will be ignored. This value must not change over time; it may be queried once, repeatedly, or never. -
close
Description copied from interface:NoClose
Calls to close are ignored whenNoClose.isNoClose()
, otherwise some action might be taken which means close calls to this object may not be skipped or assumed to be ignored.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceNoClose
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-