Class ExceptionCatchingInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    @Deprecated
    public class ExceptionCatchingInputStream
    extends java.io.InputStream
    Deprecated.
    In some cases, callers may not handle getting 0 or -1 return values from methods, which can lead to infinite loops (see #4438). Use ExceptionPassthroughInputStream instead. This class will be deleted in a future version of Glide.
    An InputStream that catches IOExceptions 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 in BitmapFactory can 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
      int available()
      Deprecated.
       
      void close()
      Deprecated.
       
      java.io.IOException getException()
      Deprecated.
       
      void mark​(int readLimit)
      Deprecated.
       
      boolean markSupported()
      Deprecated.
       
      static ExceptionCatchingInputStream obtain​(java.io.InputStream toWrap)
      Deprecated.
       
      int read()
      Deprecated.
       
      int read​(byte[] buffer)
      Deprecated.
       
      int read​(byte[] buffer, int byteOffset, int byteCount)
      Deprecated.
       
      void release()
      Deprecated.
       
      void reset()
      Deprecated.
       
      long skip​(long byteCount)
      Deprecated.
       
      • Methods inherited from class java.io.InputStream

        nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • available

        public int available()
                      throws java.io.IOException
        Deprecated.
        Overrides:
        available in class java.io.InputStream
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Deprecated.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.InputStream
        Throws:
        java.io.IOException
      • mark

        public void mark​(int readLimit)
        Deprecated.
        Overrides:
        mark in class java.io.InputStream
      • markSupported

        public boolean markSupported()
        Deprecated.
        Overrides:
        markSupported in class java.io.InputStream
      • read

        public int read​(byte[] buffer)
        Deprecated.
        Overrides:
        read in class java.io.InputStream
      • read

        public int read​(byte[] buffer,
                        int byteOffset,
                        int byteCount)
        Deprecated.
        Overrides:
        read in class java.io.InputStream
      • reset

        public void reset()
                   throws java.io.IOException
        Deprecated.
        Overrides:
        reset in class java.io.InputStream
        Throws:
        java.io.IOException
      • skip

        public long skip​(long byteCount)
        Deprecated.
        Overrides:
        skip in class java.io.InputStream
      • read

        public int read()
        Deprecated.
        Specified by:
        read in class java.io.InputStream
      • getException

        @Nullable
        public java.io.IOException getException()
        Deprecated.
      • release

        public void release()
        Deprecated.