@Override
    public GifDrawableResource decode(InputStream source, int width, int height) {
        byte[] data = inputStreamToBytes(source);
        final GifHeaderParser parser = parserPool.obtain(data);
        final GifDecoder decoder = decoderPool.obtain(provider);
        try {
            return decode(data, width, height, parser, decoder);
        } finally {
            parserPool.release(parser);
            decoderPool.release(decoder);
        }
    }
An {@link ResourceDecoder} that decodes
{@link GifDrawable} from {@link InputStream} data.
core/src/main/java/com/bumptech/glide/load/resource/gif/GifResourceDecoder.java