Class SdkLengthAwareInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- software.amazon.awssdk.core.internal.io.SdkLengthAwareInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class SdkLengthAwareInputStream extends FilterInputStream
AnInputStream
that is aware of its length. The main purpose of this class is to support truncating streams to a length that is shorter than the total length of the stream.
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description SdkLengthAwareInputStream(InputStream in, long length)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
mark(int readlimit)
int
read()
int
read(byte[] b, int off, int len)
long
remaining()
void
reset()
long
skip(long requestedBytesToSkip)
-
Methods inherited from class java.io.FilterInputStream
close, markSupported, read
-
-
-
-
Constructor Detail
-
SdkLengthAwareInputStream
public SdkLengthAwareInputStream(InputStream in, long length)
-
-
Method Detail
-
read
public int read() throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
skip
public long skip(long requestedBytesToSkip) throws IOException
- Overrides:
skip
in classFilterInputStream
- Throws:
IOException
-
available
public int available() throws IOException
- Overrides:
available
in classFilterInputStream
- Throws:
IOException
-
mark
public void mark(int readlimit)
- Overrides:
mark
in classFilterInputStream
-
reset
public void reset() throws IOException
- Overrides:
reset
in classFilterInputStream
- Throws:
IOException
-
remaining
public long remaining()
-
-