- java.lang.Object
-
- java.io.Writer
-
- com.aoapps.lang.io.WriterFacade
-
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
public final class WriterFacade extends Writer
Wraps a writer while passing-through all methods of the writer class. This is used to hide the implementation of writer from calling classes.- Author:
- AO Industries, Inc.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WriterFacadeappend(char c)WriterFacadeappend(CharSequence csq)WriterFacadeappend(CharSequence csq, int start, int end)voidclose()voidflush()static WriterFacadegetInstance(Writer out)Gets an instance of the WriterFacade that wraps the given Writer.voidwrite(char[] cbuf)voidwrite(char[] cbuf, int off, int len)voidwrite(int c)voidwrite(String str)voidwrite(String str, int off, int len)-
Methods inherited from class java.io.Writer
nullWriter
-
-
-
-
Method Detail
-
getInstance
public static WriterFacade getInstance(Writer out)
Gets an instance of the WriterFacade that wraps the given Writer. If the provided writer is already a WriterFacade, returns it without additional wrapping.
-
write
public void write(int c) throws IOException- Overrides:
writein classWriter- 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- Specified by:
writein classWriter- 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 classWriter- Throws:
IOException
-
append
public WriterFacade append(CharSequence csq) throws IOException
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
append
public WriterFacade append(CharSequence csq, int start, int end) throws IOException
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
append
public WriterFacade append(char c) throws IOException
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-
-