Package com.helger.commons.io.stream
Class LoggingInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.helger.commons.io.stream.WrappedInputStream
com.helger.commons.io.stream.LoggingInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
A wrapper around an
InputStream that logs read and skip actions.- Author:
- Philip Helger
-
Field Summary
Fields inherited from class java.io.FilterInputStream
in -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()final longfinal voidmark(int nReadlimit) protected voidonClose(long nCurrentPosition) protected voidonMark(int nReadLimit, long nCurrentPosition) protected voidonRead(int nBytesRead, long nNewPosition) protected voidonReset(long nCurrentPosition) protected voidonSkip(long nBytesSkipped, long nNewPosition) final intread()final intread(byte[] aBuf, int nOffset, int nLength) final voidreset()final longskip(long n) toString()Methods inherited from class com.helger.commons.io.stream.WrappedInputStream
getWrappedInputStreamMethods inherited from class java.io.FilterInputStream
available, markSupported, readMethods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
LoggingInputStream
- Parameters:
aSourceIS- The input stream to be logged. May not benull.
-
-
Method Details
-
getPosition
public final long getPosition()- Returns:
- The current read position. Always ≥ 0.
-
onRead
-
onSkip
-
onMark
-
onReset
-
onClose
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classFilterInputStream- Throws:
IOException
-
mark
- Overrides:
markin classFilterInputStream
-
reset
- Overrides:
resetin classFilterInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterInputStream- Throws:
IOException
-
toString
- Overrides:
toStringin classWrappedInputStream
-