-
- All Implemented Interfaces:
-
java.io.Closeable,java.lang.AutoCloseable
public final class ContentLengthInputStream extends FilterInputStream
Uses the content length as the basis for the return value of available and verifies that at least content length bytes are returned from the various read methods.
-
-
Method Summary
Modifier and Type Method Description static InputStreamobtain(@NonNull() InputStream other, @Nullable() String contentLengthHeader)static InputStreamobtain(@NonNull() InputStream other, long contentLength)synchronized intavailable()synchronized intread()intread(Array<byte> buffer)synchronized intread(Array<byte> buffer, int byteOffset, int byteCount)-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skip -
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
obtain
@NonNull() static InputStream obtain(@NonNull() InputStream other, @Nullable() String contentLengthHeader)
-
obtain
@NonNull() static InputStream obtain(@NonNull() InputStream other, long contentLength)
-
available
synchronized int available()
-
read
synchronized int read()
-
-
-
-