Package com.amazonaws.event
Class ProgressInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.amazonaws.internal.SdkFilterInputStream
com.amazonaws.event.ProgressInputStream
- All Implemented Interfaces:
com.amazonaws.internal.MetricAware,com.amazonaws.internal.Releasable,Closeable,AutoCloseable
public abstract class ProgressInputStream
extends com.amazonaws.internal.SdkFilterInputStream
Used for input stream progress tracking purposes.
-
Field Summary
Fields inherited from class java.io.FilterInputStream
in -
Constructor Summary
ConstructorsConstructorDescriptionProgressInputStream(InputStream is, ProgressListener listener) ProgressInputStream(InputStream is, ProgressListener listener, int notifyThresHold) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()final ProgressListenerprotected final longprotected final intfinal InputStreamstatic InputStreamReturns an input stream for request progress tracking purposes.static InputStreamReturns an input stream for response progress tracking purposes.protected voidonClose()Defaults to behave the same asonEOF().protected voidonEOF()An end-of-file event is to be notified.protected voidThe read method is called for the very first time.protected voidUpon notification of the number of bytes transferred since last notification.protected voidonReset()A reset event is to be notified.intread()intread(byte[] b, int off, int len) voidreset()Methods inherited from class com.amazonaws.internal.SdkFilterInputStream
abort, abortIfNeeded, available, isMetricActivated, mark, markSupported, release, skipMethods inherited from class java.io.FilterInputStream
readMethods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
ProgressInputStream
-
ProgressInputStream
-
-
Method Details
-
inputStreamForRequest
Returns an input stream for request progress tracking purposes. If request/response progress tracking is not enabled, this method simply return the given input stream as is.- Parameters:
is- the request content input stream
-
inputStreamForResponse
Returns an input stream for response progress tracking purposes. If request/response progress tracking is not enabled, this method simply return the given input stream as is.- Parameters:
is- the response content input stream
-
onFirstRead
protected void onFirstRead()The read method is called for the very first time. Defaults to do nothing. -
onEOF
protected void onEOF()An end-of-file event is to be notified. Defaults to do nothing. -
onClose
protected void onClose()Defaults to behave the same asonEOF(). -
onReset
protected void onReset()A reset event is to be notified. Default to do nothing. -
onNotifyBytesRead
protected void onNotifyBytesRead()Upon notification of the number of bytes transferred since last notification. Default to do nothing. -
read
- Overrides:
readin classcom.amazonaws.internal.SdkFilterInputStream- Throws:
IOException
-
reset
- Overrides:
resetin classcom.amazonaws.internal.SdkFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classcom.amazonaws.internal.SdkFilterInputStream- Throws:
IOException
-
getWrappedInputStream
-
getUnnotifiedByteCount
protected final int getUnnotifiedByteCount() -
getNotifiedByteCount
protected final long getNotifiedByteCount() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classcom.amazonaws.internal.SdkFilterInputStream- Throws:
IOException
-
getListener
-