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 TypeMethodDescriptionvoid
close()
final ProgressListener
protected final long
protected final int
final InputStream
static InputStream
Returns an input stream for request progress tracking purposes.static InputStream
Returns an input stream for response progress tracking purposes.protected void
onClose()
Defaults to behave the same asonEOF()
.protected void
onEOF()
An end-of-file event is to be notified.protected void
The read method is called for the very first time.protected void
Upon notification of the number of bytes transferred since last notification.protected void
onReset()
A reset event is to be notified.int
read()
int
read
(byte[] b, int off, int len) void
reset()
Methods inherited from class com.amazonaws.internal.SdkFilterInputStream
abort, abortIfNeeded, available, isMetricActivated, mark, markSupported, release, skip
Methods inherited from class java.io.FilterInputStream
read
Methods 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:
read
in classcom.amazonaws.internal.SdkFilterInputStream
- Throws:
IOException
-
reset
- Overrides:
reset
in classcom.amazonaws.internal.SdkFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classcom.amazonaws.internal.SdkFilterInputStream
- Throws:
IOException
-
getWrappedInputStream
-
getUnnotifiedByteCount
protected final int getUnnotifiedByteCount() -
getNotifiedByteCount
protected final long getNotifiedByteCount() -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classcom.amazonaws.internal.SdkFilterInputStream
- Throws:
IOException
-
getListener
-