Package org.cactoos.io
Class LoggingOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.cactoos.io.LoggingOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
public final class LoggingOutputStream extends OutputStream
Logged output stream.There is no thread-safety guarantee.
- Since:
- 0.29
-
-
Constructor Summary
Constructors Constructor Description LoggingOutputStream(OutputStream output, String dst)
Ctor.LoggingOutputStream(OutputStream output, String dst, Logger lgr)
Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
void
write(byte[] buf)
void
write(byte[] buf, int offset, int len)
void
write(int data)
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
LoggingOutputStream
public LoggingOutputStream(OutputStream output, String dst)
Ctor.- Parameters:
output
- Destination of datadst
- The name of source data
-
LoggingOutputStream
public LoggingOutputStream(OutputStream output, String dst, Logger lgr)
Ctor.- Parameters:
output
- Destination of datadst
- The name of source datalgr
- Message logger
-
-
Method Detail
-
write
public void write(int data) throws IOException
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
public void write(byte[] buf) throws IOException
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
public void write(byte[] buf, int offset, int len) throws IOException
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
-