Package com.helger.commons.io.stream
Class LoggingWriter
- java.lang.Object
-
- java.io.Writer
-
- java.io.FilterWriter
-
- com.helger.commons.io.stream.WrappedWriter
-
- com.helger.commons.io.stream.LoggingWriter
-
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
public class LoggingWriter extends WrappedWriter
A wrapper around anWriterthat logs what he is doing.- Since:
- 9.3.8
- Author:
- Philip Helger
-
-
Field Summary
-
Fields inherited from class java.io.FilterWriter
out
-
-
Constructor Summary
Constructors Constructor Description LoggingWriter(Writer aSourceReader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()longgetBytesWritten()protected voidonClose(long nTotalBytesWritten)protected voidonWrite(int nBytesWritten, long nTotalBytesWritten)StringtoString()voidwrite(char[] aBuf, int nOfs, int nLen)voidwrite(int b)-
Methods inherited from class com.helger.commons.io.stream.WrappedWriter
getWrappedWriter
-
Methods inherited from class java.io.FilterWriter
flush, write
-
-
-
-
Method Detail
-
getBytesWritten
@Nonnegative public final long getBytesWritten()
- Returns:
- The number of written bytes. Always ≥ 0.
-
onWrite
@OverrideOnDemand protected void onWrite(@Nonnegative int nBytesWritten, long nTotalBytesWritten)
-
onClose
@OverrideOnDemand protected void onClose(long nTotalBytesWritten)
-
write
public final void write(int b) throws IOException- Overrides:
writein classFilterWriter- Throws:
IOException
-
write
public final void write(@Nonnull char[] aBuf, int nOfs, int nLen) throws IOException
- Overrides:
writein classFilterWriter- Throws:
IOException
-
close
public final void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterWriter- Throws:
IOException
-
toString
public String toString()
- Overrides:
toStringin classWrappedWriter
-
-