
org.xhtmlrenderer.util.InputSources Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of flying-saucer-core Show documentation
Show all versions of flying-saucer-core Show documentation
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