Package com.bumptech.glide.util
Class ContentLengthInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- com.bumptech.glide.util.ContentLengthInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public final class ContentLengthInputStream extends java.io.FilterInputStreamUses the content length as the basis for the return value ofavailable()and verifies that at least content length bytes are returned from the various read methods.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()static java.io.InputStreamobtain(java.io.InputStream other, long contentLength)static java.io.InputStreamobtain(java.io.InputStream other, java.lang.String contentLengthHeader)intread()intread(byte[] buffer)intread(byte[] buffer, int byteOffset, int byteCount)
-
-
-
Method Detail
-
obtain
@NonNull public static java.io.InputStream obtain(@NonNull java.io.InputStream other, @Nullable java.lang.String contentLengthHeader)
-
obtain
@NonNull public static java.io.InputStream obtain(@NonNull java.io.InputStream other, long contentLength)
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.FilterInputStream- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
read
public int read(byte[] buffer) throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
read
public int read(byte[] buffer, int byteOffset, int byteCount) throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
-