Class SdkLengthAwareInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
software.amazon.awssdk.core.internal.io.SdkLengthAwareInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
An
InputStream
that is aware of its length. This class enforces that we sent exactly the number of bytes equal to
the input length. If the wrapped stream has more bytes than the expected length, it will be truncated to length. If the stream
has less bytes (i.e. reaches EOF) before the expected length is reached, it will throw IOException
.-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.FilterInputStream
close, markSupported, read
-
Constructor Details
-
SdkLengthAwareInputStream
-
-
Method Details
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classFilterInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classFilterInputStream
- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
mark
in classFilterInputStream
-
reset
- Overrides:
reset
in classFilterInputStream
- Throws:
IOException
-
remaining
public long remaining()
-