Class MeasuredSizeInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.coreoz.plume.file.services.data.MeasuredSizeInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class MeasuredSizeInputStream extends InputStream
An input stream wrapper that exposes a method to know the number of bytes that has been read in the stream.
-
-
Constructor Summary
Constructors Constructor Description MeasuredSizeInputStream(InputStream baseInputStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()longgetInputStreamTotalSize()Returns the number of bytes that has been readintread()intread(byte[] b, int off, int len)-
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
MeasuredSizeInputStream
public MeasuredSizeInputStream(InputStream baseInputStream)
-
-
Method Detail
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
getInputStreamTotalSize
public long getInputStreamTotalSize()
Returns the number of bytes that has been read
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
-