public final class ContentLengthInputStream extends FilterInputStream
available()
and verifies
that at least content length bytes are returned from the various read methods.in
Modifier and Type | Method and Description |
---|---|
int |
available() |
static InputStream |
obtain(InputStream other,
long contentLength) |
static InputStream |
obtain(InputStream other,
String contentLengthHeader) |
int |
read() |
int |
read(byte[] buffer) |
int |
read(byte[] buffer,
int byteOffset,
int byteCount) |
close, mark, markSupported, reset, skip
@NonNull public static InputStream obtain(@NonNull InputStream other, @Nullable String contentLengthHeader)
@NonNull public static InputStream obtain(@NonNull InputStream other, long contentLength)
public int available() throws IOException
available
in class FilterInputStream
IOException
public int read() throws IOException
read
in class FilterInputStream
IOException
public int read(byte[] buffer) throws IOException
read
in class FilterInputStream
IOException
public int read(byte[] buffer, int byteOffset, int byteCount) throws IOException
read
in class FilterInputStream
IOException