public Resource<SVG> decode(
            @NonNull InputStream source, int width, int height, @NonNull Options options)
            throws IOException {
        try {
            SVG svg = SVG.getFromInputStream(source);
            if (width > 0) {
                svg.setDocumentWidth(width);
            }

            if (height > 0) {
                svg.setDocumentHeight(height);
            }
            return new SimpleResource<>(svg);
        } catch (SVGParseException ex) {
            throw new IOException("Cannot load SVG from stream", ex);
        }
    }
Decodes an SVG internal representation from an {@link InputStream}.
app/src/main/java/com/github/pockethub/android/markwon/SvgDecoder.java