java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.BufferedInputStream
org.xhtmlrenderer.util.ContentTypeDetectingInputStreamWrapper
- All Implemented Interfaces:
Closeable,AutoCloseable
This class wraps an input stream and detects if it contains certain content using "magic numbers".
...
currently only pdf detection is implemented
- Author:
- mwyraz
-
Field Summary
Fields inherited from class java.io.FilterInputStream
in -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable ContentTypeDetectingInputStreamWrapperdetectContentType(@Nullable InputStream is) booleanisPdf()booleanisSvg()Methods inherited from class java.io.BufferedInputStream
available, close, mark, markSupported, read, read, reset, skip, transferToMethods inherited from class java.io.FilterInputStream
readMethods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes
-
Method Details
-
detectContentType
@CheckReturnValue public static @Nullable ContentTypeDetectingInputStreamWrapper detectContentType(@Nullable InputStream is) throws IOException - Throws:
IOException
-
isPdf
public boolean isPdf() -
isSvg
public boolean isSvg()
-