Class GifHelper


  • public class GifHelper
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      GifHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static GifDrawable getDrawableForBytes​(android.content.Context context, byte[] data, boolean start)
      Get a GifDrawable for the given byte array
      static boolean isPotentiallyAGif​(int[] data)
      Returns whether the data represents a GIF
      • Methods inherited from class java.lang.Object

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

      • NEEDED_BYTES_FOR_TYPE_CHECK

        public static final int NEEDED_BYTES_FOR_TYPE_CHECK
        See Also:
        Constant Field Values
    • Constructor Detail

      • GifHelper

        public GifHelper()
    • Method Detail

      • isPotentiallyAGif

        public static boolean isPotentiallyAGif​(@NonNull
                                                int[] data)
        Returns whether the data represents a GIF

        Only the first 6 bytes are needed

      • getDrawableForBytes

        public static GifDrawable getDrawableForBytes​(@NonNull
                                                      android.content.Context context,
                                                      @NonNull
                                                      byte[] data,
                                                      boolean start)
        Get a GifDrawable for the given byte array

        It is assumed that the byte array has been checked with isPotentiallyAGif(int[])