@NotThreadSafe public abstract class ProgressInputStream extends SdkFilterInputStream
in
Constructor and Description |
---|
ProgressInputStream(InputStream is,
ProgressListener listener) |
ProgressInputStream(InputStream is,
ProgressListener listener,
int notifyThresHold) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
ProgressListener |
getListener() |
protected long |
getNotifiedByteCount() |
protected int |
getUnnotifiedByteCount() |
InputStream |
getWrappedInputStream() |
static InputStream |
inputStreamForRequest(InputStream is,
AmazonWebServiceRequest req)
Deprecated.
|
static InputStream |
inputStreamForRequest(InputStream is,
ProgressListener progressListener) |
static InputStream |
inputStreamForResponse(InputStream is,
AmazonWebServiceRequest req)
Returns an input stream for response progress tracking purposes.
|
static InputStream |
inputStreamForResponse(InputStream is,
ProgressListener progressListener)
Returns an input stream for response progress tracking purposes.
|
protected void |
onClose()
Defaults to behave the same as
onEOF() . |
protected void |
onEOF()
An end-of-file event is to be notified.
|
protected void |
onFirstRead()
The read method is called for the very first time.
|
protected void |
onNotifyBytesRead()
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() |
abort, abortIfNeeded, available, getDelegateStream, isAborted, isMetricActivated, mark, markSupported, release, skip
read
public ProgressInputStream(InputStream is, ProgressListener listener)
public ProgressInputStream(InputStream is, ProgressListener listener, int notifyThresHold)
@Deprecated public static InputStream inputStreamForRequest(InputStream is, AmazonWebServiceRequest req)
is
- the request content input streampublic static InputStream inputStreamForRequest(InputStream is, ProgressListener progressListener)
is
- the request content input streamprogressListener
- Optional progress listenerpublic static InputStream inputStreamForResponse(InputStream is, AmazonWebServiceRequest req)
is
- the response content input streampublic static InputStream inputStreamForResponse(InputStream is, ProgressListener progressListener)
is
- the response content input streamprogressListener
- Optional progress listenerprotected void onFirstRead()
protected void onEOF()
protected void onClose()
onEOF()
.protected void onReset()
protected void onNotifyBytesRead()
public int read() throws IOException
read
in class SdkFilterInputStream
IOException
public void reset() throws IOException
reset
in class SdkFilterInputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class SdkFilterInputStream
IOException
public final InputStream getWrappedInputStream()
protected final int getUnnotifiedByteCount()
protected final long getNotifiedByteCount()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class SdkFilterInputStream
IOException
public final ProgressListener getListener()
Copyright © 2022. All rights reserved.