Class ProgressTrackingInputStream
java.lang.Object
java.io.InputStream
com.amilesend.client.connection.file.ProgressTrackingInputStream
- All Implemented Interfaces:
Closeable, AutoCloseable
Tracking input stream to monitor the amount of bytes read.
-
Constructor Summary
ConstructorsConstructorDescriptionProgressTrackingInputStream(@NonNull InputStream delegate, TransferProgressCallback callback, long totalBytes) Creates a newProgressTrackingInputStreamobject. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intread()intread(@NonNull byte[] b) intread(byte[] b, int off, int len) byte[]intreadNBytes(byte[] b, int off, int len) byte[]readNBytes(int len) longskip(long n) Methods inherited from class InputStream
available, mark, markSupported, nullInputStream, reset, transferTo
-
Constructor Details
-
ProgressTrackingInputStream
public ProgressTrackingInputStream(@NonNull InputStream delegate, TransferProgressCallback callback, long totalBytes) Creates a newProgressTrackingInputStreamobject.- Parameters:
delegate- the delegate input streamcallback- the callback to notifytotalBytes- the total bytes to read
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
readAllBytes
- Overrides:
readAllBytesin classInputStream- Throws:
IOException
-
readNBytes
- Overrides:
readNBytesin classInputStream- Throws:
IOException
-
readNBytes
- Overrides:
readNBytesin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-