Class TextWriterAdapter
- java.lang.Object
-
- java.io.Writer
-
- org.forgerock.audit.events.handlers.writers.TextWriterAdapter
-
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
,TextWriter
public class TextWriterAdapter extends Writer implements TextWriter
Wraps aTextWriter
in aWriter
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.forgerock.audit.events.handlers.writers.TextWriter
TextWriter.Stream
-
-
Constructor Summary
Constructors Constructor Description TextWriterAdapter(TextWriter delegate)
Creates the writer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
Flushes any buffered contents of the output stream.long
getBytesWritten()
Retrieves the number of bytes written by this writer.void
shutdown()
Releases any resources held by the writer.void
write(char[] cbuf)
void
write(char[] cbuf, int off, int len)
void
write(int c)
void
write(String str)
Writes some text to the output stream.void
write(String str, int off, int len)
-
Methods inherited from class java.io.Writer
append, append, append, nullWriter
-
-
-
-
Constructor Detail
-
TextWriterAdapter
public TextWriterAdapter(TextWriter delegate)
Creates the writer.- Parameters:
delegate
- Delegate writer.
-
-
Method Detail
-
write
public void write(char[] cbuf, int off, int len) throws IOException
- Specified by:
write
in classWriter
- Throws:
IOException
-
write
public void write(int c) throws IOException
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
public void write(char[] cbuf) throws IOException
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
public void write(String str) throws IOException
Description copied from interface:TextWriter
Writes some text to the output stream.- Specified by:
write
in interfaceTextWriter
- Overrides:
write
in classWriter
- Parameters:
str
- The text to write- Throws:
IOException
- If a problem occurs.
-
write
public void write(String str, int off, int len) throws IOException
- Overrides:
write
in classWriter
- Throws:
IOException
-
flush
public void flush() throws IOException
Description copied from interface:TextWriter
Flushes any buffered contents of the output stream.- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in interfaceTextWriter
- Specified by:
flush
in classWriter
- Throws:
IOException
- If a problem occurs.
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classWriter
- Throws:
IOException
-
shutdown
public void shutdown()
Description copied from interface:TextWriter
Releases any resources held by the writer.- Specified by:
shutdown
in interfaceTextWriter
-
getBytesWritten
public long getBytesWritten()
Description copied from interface:TextWriter
Retrieves the number of bytes written by this writer.- Specified by:
getBytesWritten
in interfaceTextWriter
- Returns:
- the number of bytes written by this writer.
-
-