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