- java.lang.Object
-
- java.io.Writer
-
- java.io.FilterWriter
-
- com.aoapps.lang.io.EncoderWriter
-
- All Implemented Interfaces:
NoClose,Closeable,Flushable,Appendable,AutoCloseable
public class EncoderWriter extends FilterWriter implements NoClose
Writer that encodes during write.See MediaEncoder
- Author:
- AO Industries, Inc.
-
-
Field Summary
-
Fields inherited from class java.io.FilterWriter
out
-
-
Constructor Summary
Constructors Constructor Description EncoderWriter(Encoder encoder, Writer out)EncoderWriter(Encoder encoder, Writer out, boolean outOptimized)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description EncoderWriterappend(char c)EncoderWriterappend(CharSequence csq)EncoderWriterappend(CharSequence csq, int start, int end)EncodergetEncoder()This method may be overridden for the purpose of covariant return, but must returnencoder.WritergetOut()Gets the wrapped writer, which has been optimized viaCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder).booleanisNoClose()Determines if calls toNoClose.close()will be ignored.voidwrite(char[] cbuf)voidwrite(char[] cbuf, int off, int len)voidwrite(int c)voidwrite(String str)voidwrite(String str, int off, int len)voidwritePrefix()voidwriteSuffix()Deprecated.Please usewriteSuffix(boolean)while specifying desired trim.voidwriteSuffix(boolean trim)-
Methods inherited from class java.io.FilterWriter
close, flush
-
Methods inherited from class java.io.Writer
nullWriter
-
-
-
-
Constructor Detail
-
EncoderWriter
public EncoderWriter(Encoder encoder, Writer out, boolean outOptimized)
- 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
public EncoderWriter(Encoder encoder, Writer out)
- Parameters:
out- Will be passed throughCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder)
-
-
Method Detail
-
getEncoder
public Encoder getEncoder()
This method may be overridden for the purpose of covariant return, but must returnencoder.
-
getOut
public Writer 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
public void writePrefix() throws IOException- Throws:
IOException
-
write
public void write(int c) throws IOException- Overrides:
writein classFilterWriter- Throws:
IOException
-
write
public void write(char[] cbuf) throws IOException- Overrides:
writein classWriter- Throws:
IOException
-
write
public void write(char[] cbuf, int off, int len) throws IOException- Overrides:
writein classFilterWriter- Throws:
IOException
-
write
public void write(String str) throws IOException
- Overrides:
writein classWriter- Throws:
IOException
-
write
public void write(String str, int off, int len) throws IOException
- Overrides:
writein classFilterWriter- Throws:
IOException
-
append
public EncoderWriter append(char c) throws IOException
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
append
public EncoderWriter append(CharSequence csq) throws IOException
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
append
public EncoderWriter append(CharSequence csq, int start, int end) throws IOException
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
writeSuffix
@Deprecated public final void writeSuffix() throws IOException
Deprecated.Please usewriteSuffix(boolean)while specifying desired trim.- Throws:
IOException
-
writeSuffix
public void writeSuffix(boolean trim) throws IOException- Parameters:
trim- Requests that the buffer be trimmed, if buffered and trim supported.- Throws:
IOException
-
-