public class SdkLengthAwareInputStream extends FilterInputStream
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.in| Constructor and Description |
|---|
SdkLengthAwareInputStream(InputStream in,
long length) |
| Modifier and Type | Method and 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) |
close, markSupported, readpublic SdkLengthAwareInputStream(InputStream in, long length)
public int read()
throws IOException
read in class FilterInputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class FilterInputStreamIOExceptionpublic long skip(long requestedBytesToSkip)
throws IOException
skip in class FilterInputStreamIOExceptionpublic int available()
throws IOException
available in class FilterInputStreamIOExceptionpublic void mark(int readlimit)
mark in class FilterInputStreampublic void reset()
throws IOException
reset in class FilterInputStreamIOExceptionpublic long remaining()
Copyright © 2026. All rights reserved.