Package com.bumptech.glide.util
Class ExceptionCatchingInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.bumptech.glide.util.ExceptionCatchingInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
@Deprecated public class ExceptionCatchingInputStream extends java.io.InputStreamDeprecated.In some cases, callers may not handle getting 0 or -1 return values from methods, which can lead to infinite loops (see #4438). UseExceptionPassthroughInputStreaminstead. This class will be deleted in a future version of Glide.AnInputStreamthat catchesIOExceptions during read and skip calls and stores them so they can later be handled or thrown. This class is a workaround for a framework issue where exceptions during reads while decoding bitmaps inBitmapFactorycan return partially decoded bitmaps.See https://github.com/bumptech/glide/issues/126.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intavailable()Deprecated.voidclose()Deprecated.java.io.IOExceptiongetException()Deprecated.voidmark(int readLimit)Deprecated.booleanmarkSupported()Deprecated.static ExceptionCatchingInputStreamobtain(java.io.InputStream toWrap)Deprecated.intread()Deprecated.intread(byte[] buffer)Deprecated.intread(byte[] buffer, int byteOffset, int byteCount)Deprecated.voidrelease()Deprecated.voidreset()Deprecated.longskip(long byteCount)Deprecated.
-
-
-
Method Detail
-
obtain
@NonNull public static ExceptionCatchingInputStream obtain(@NonNull java.io.InputStream toWrap)
Deprecated.
-
available
public int available() throws java.io.IOExceptionDeprecated.- Overrides:
availablein classjava.io.InputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionDeprecated.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
mark
public void mark(int readLimit)
Deprecated.- Overrides:
markin classjava.io.InputStream
-
markSupported
public boolean markSupported()
Deprecated.- Overrides:
markSupportedin classjava.io.InputStream
-
read
public int read(byte[] buffer)
Deprecated.- Overrides:
readin classjava.io.InputStream
-
read
public int read(byte[] buffer, int byteOffset, int byteCount)Deprecated.- Overrides:
readin classjava.io.InputStream
-
reset
public void reset() throws java.io.IOExceptionDeprecated.- Overrides:
resetin classjava.io.InputStream- Throws:
java.io.IOException
-
skip
public long skip(long byteCount)
Deprecated.- Overrides:
skipin classjava.io.InputStream
-
read
public int read()
Deprecated.- Specified by:
readin classjava.io.InputStream
-
getException
@Nullable public java.io.IOException getException()
Deprecated.
-
release
public void release()
Deprecated.
-
-