java.lang.Object
java.io.Writer
java.io.FilterWriter
com.aoapps.lang.io.EncoderWriter
- All Implemented Interfaces:
NoClose,Closeable,Flushable,Appendable,AutoCloseable
Writer that encodes during write.
See MediaEncoder
- Author:
- AO Industries, Inc.
-
Field Summary
Fields inherited from class java.io.FilterWriter
out -
Constructor Summary
ConstructorsConstructorDescriptionEncoderWriter(Encoder encoder, Writer out) EncoderWriter(Encoder encoder, Writer out, boolean outOptimized) -
Method Summary
Modifier and TypeMethodDescriptionappend(char c) append(CharSequence csq) append(CharSequence csq, int start, int end) This method may be overridden for the purpose of covariant return, but must returnencoder.getOut()Gets the wrapped writer, which has been optimized viaCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder).booleanDetermines if calls toNoClose.close()will be ignored.voidwrite(char[] cbuf) voidwrite(char[] cbuf, int off, int len) voidwrite(int c) voidvoidvoidfinal voidDeprecated.voidwriteSuffix(boolean trim) Methods inherited from class java.io.FilterWriter
close, flushMethods inherited from class java.io.Writer
nullWriter
-
Constructor Details
-
EncoderWriter
- Parameters:
out- Conditionally passed throughCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder)outOptimized- Isoutalready known to have been passed throughCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder)?
-
EncoderWriter
- Parameters:
out- Will be passed throughCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder)
-
-
Method Details
-
getEncoder
This method may be overridden for the purpose of covariant return, but must returnencoder. -
getOut
Gets the wrapped writer, which has been optimized viaCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder).This method may be overridden for the purpose of covariant return, but must return
FilterWriter.out. -
isNoClose
public boolean isNoClose()Description copied from interface:NoCloseDetermines if calls toNoClose.close()will be ignored. This value must not change over time; it may be queried once, repeatedly, or never. -
writePrefix
- Throws:
IOException
-
write
- Overrides:
writein classFilterWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classFilterWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classFilterWriter- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
writeSuffix
Deprecated.Please usewriteSuffix(boolean)while specifying desired trim.- Throws:
IOException
-
writeSuffix
- Parameters:
trim- Requests that the buffer be trimmed, if buffered and trim supported.- Throws:
IOException
-

writeSuffix(boolean)while specifying desired trim.