All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.xhtmlrenderer.util.InputSources Maven / Gradle / Ivy

Go to download

Flying Saucer is a CSS 2.1 renderer written in Java. This artifact contains the core rendering and layout code as well as Java2D output.

The newest version!
package org.xhtmlrenderer.util;

import org.jspecify.annotations.Nullable;
import org.xml.sax.InputSource;

import java.io.BufferedInputStream;
import java.io.InputStream;
import java.io.StringReader;
import java.net.URL;

public class InputSources {
    @Nullable
    public static InputSource fromStream(@Nullable InputStream is) {
        return is == null ? null : new InputSource(new BufferedInputStream(is));
    }

    public static InputSource fromURL(URL source) {
        return new InputSource(source.toString());
    }

    public static InputSource fromString(String source) {
        return new InputSource(new StringReader(source));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy