Class BytesReadTrackingInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- software.amazon.awssdk.core.io.SdkFilterInputStream
-
- software.amazon.awssdk.core.internal.metrics.BytesReadTrackingInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Releasable
,Abortable
public final class BytesReadTrackingInputStream extends SdkFilterInputStream implements Abortable
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description BytesReadTrackingInputStream(AbortableInputStream in, AtomicLong bytesRead)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abort()
Can be used to provide abortion logic prior to throwing the AbortedException.long
bytesRead()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
long
skip(long n)
-
Methods inherited from class software.amazon.awssdk.core.io.SdkFilterInputStream
abortIfNeeded, available, close, mark, markSupported, release, reset
-
-
-
-
Constructor Detail
-
BytesReadTrackingInputStream
public BytesReadTrackingInputStream(AbortableInputStream in, AtomicLong bytesRead)
-
-
Method Detail
-
bytesRead
public long bytesRead()
-
read
public int read() throws IOException
- Overrides:
read
in classSdkFilterInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classSdkFilterInputStream
- Throws:
IOException
-
skip
public long skip(long n) throws IOException
- Overrides:
skip
in classSdkFilterInputStream
- Throws:
IOException
-
read
public int read(byte[] b) throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
abort
public void abort()
Description copied from class:SdkFilterInputStream
Can be used to provide abortion logic prior to throwing the AbortedException. No-op by default.- Specified by:
abort
in interfaceAbortable
- Overrides:
abort
in classSdkFilterInputStream
-
-