public static GifImage createFromByteBuffer(ByteBuffer byteBuffer, ImageDecodeOptions options) {
    ensure();
    byteBuffer.rewind();

    GifImage image =
        nativeCreateFromDirectByteBuffer(
            byteBuffer, options.maxDimensionPx, options.forceStaticImage);
    image.mDecodeBitmapConfig = options.animatedBitmapConfig;
    return image;
  }
Creates a {@link GifImage} from a ByteBuffer containing the image. This will throw if it fails
to create.

@param byteBuffer the ByteBuffer containing the image (a copy will be made)
animated-gif/src/main/java/com/facebook/animated/gif/GifImage.java