private GifDecoder decodeHeaders(byte[] data) {
        GifHeaderParser parser = factory.buildParser();
        parser.setData(data);
        GifHeader header = parser.parseHeader();

        GifDecoder decoder = factory.buildDecoder(provider);
        decoder.setData(header, data);
        decoder.advance();

        return decoder;
    }
An {@link ResourceEncoder} that can write
{@link GifDrawable} to cache.
core/src/main/java/com/bumptech/glide/load/resource/gif/GifResourceEncoder.java