Package org.apache.syncope.common.lib
Class LogOutputStream
java.lang.Object
java.io.OutputStream
org.apache.syncope.common.lib.LogOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Delegates output stream writing onto an SLF4J logger.
Inspired by
org.apache.commons.exec.LogOutputStream
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Writes all remaining data from the buffer.void
flush()
Flush this log stream.void
write
(byte[] b, int off, int len) Write a block of characters to the output streamvoid
write
(int cc) Write the data to the buffer and flush the buffer, if a line separator is detected.Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
Constructor Details
-
LogOutputStream
-
-
Method Details
-
write
public void write(int cc) Write the data to the buffer and flush the buffer, if a line separator is detected.- Specified by:
write
in classOutputStream
- Parameters:
cc
- data to log (byte).
-
flush
public void flush()Flush this log stream.- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
-
close
Writes all remaining data from the buffer.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
- if an I/O error occurs- See Also:
-
write
public void write(byte[] b, int off, int len) Write a block of characters to the output stream- Overrides:
write
in classOutputStream
- Parameters:
b
- the array containing the dataoff
- the offset into the array where data startslen
- the length of block
-