Package com.bumptech.glide.util
Class ContentLengthInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.bumptech.glide.util.ContentLengthInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
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.-
Field Summary
Fields inherited from class java.io.FilterInputStream
in -
Method Summary
Modifier and TypeMethodDescriptionintstatic InputStreamobtain(InputStream other, long contentLength) static InputStreamobtain(InputStream other, String contentLengthHeader) intread()intread(byte[] buffer) intread(byte[] buffer, int byteOffset, int byteCount) Methods inherited from class java.io.FilterInputStream
close, mark, markSupported, reset, skipMethods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Method Details
-
obtain
@NonNull public static InputStream obtain(@NonNull InputStream other, @Nullable String contentLengthHeader) -
obtain
-
available
- Overrides:
availablein classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-