@Override
    public boolean encode(ImageVideoWrapper data, OutputStream os) {
        if (data.getStream() != null) {
            return streamEncoder.encode(data.getStream(), os);
        } else {
            return fileDescriptorEncoder.encode(data.getFileDescriptor(), os);
        }
    }
A source encoder that writes a {@link ImageVideoWrapper} to disk by preferentially
writing data from the wrapper's {@link InputStream} and falling back to the wrapper's
{@link ParcelFileDescriptor} if the {@link InputStream} isn't available.
core/src/main/java/com/bumptech/glide/load/model/ImageVideoWrapperEncoder.java