|
xmlgraphics-commons 1.3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.xmlgraphics.image.loader.util.ImageUtil
public class ImageUtil
Helper and convenience methods for working with the image package.
Constructor Summary | |
---|---|
ImageUtil()
|
Method Summary | |
---|---|
static java.io.InputStream |
autoDecorateInputStream(java.io.InputStream in)
Automatically decorates an InputStream so it is buffered. |
static void |
closeQuietly(javax.xml.transform.Source src)
Closes the InputStreams or ImageInputStreams of Source objects. |
static java.io.InputStream |
decorateMarkSupported(java.io.InputStream in)
Decorates an InputStream with a BufferedInputStream if it doesn't support mark()/reset(). |
static java.util.Map |
getDefaultHints(ImageSessionContext session)
Creates a new hint Map with values from the FOUserAgent. |
static javax.imageio.stream.ImageInputStream |
getImageInputStream(javax.xml.transform.Source src)
Returns the ImageInputStream of a Source object. |
static java.io.InputStream |
getInputStream(javax.xml.transform.Source src)
Returns the InputStream of a Source object. |
static java.lang.Integer |
getPageIndexFromURI(java.lang.String uri)
Extracts page index information from a URI. |
static boolean |
hasImageInputStream(javax.xml.transform.Source src)
Indicates whether the Source object has an ImageInputStream instance. |
static boolean |
hasInputStream(javax.xml.transform.Source src)
Indicates whether the Source object has an InputStream instance. |
static boolean |
hasReader(javax.xml.transform.Source src)
Indicates whether the Source object has a Reader instance. |
static javax.imageio.stream.ImageInputStream |
ignoreFlushing(javax.imageio.stream.ImageInputStream in)
Decorates an ImageInputStream so the flush*() methods are ignored and have no effect. |
static boolean |
isGZIPCompressed(java.io.InputStream in)
Indicates whether an InputStream is GZIP compressed. |
static javax.imageio.stream.ImageInputStream |
needImageInputStream(javax.xml.transform.Source src)
Returns the ImageInputStream of a Source object. |
static java.io.InputStream |
needInputStream(javax.xml.transform.Source src)
Returns the InputStream of a Source object. |
static int |
needPageIndexFromURI(java.lang.String uri)
Extracts page index information from a URI. |
static void |
removeStreams(javax.xml.transform.Source src)
Removes any references to InputStreams or Readers from the given Source to prohibit accidental/unwanted use by a component further downstream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImageUtil()
Method Detail |
---|
public static java.io.InputStream getInputStream(javax.xml.transform.Source src)
src
- the Source object
public static javax.imageio.stream.ImageInputStream getImageInputStream(javax.xml.transform.Source src)
src
- the Source object
public static java.io.InputStream needInputStream(javax.xml.transform.Source src)
src
- the Source object
public static javax.imageio.stream.ImageInputStream needImageInputStream(javax.xml.transform.Source src)
src
- the Source object
public static boolean hasInputStream(javax.xml.transform.Source src)
src
- the Source object
public static boolean hasReader(javax.xml.transform.Source src)
src
- the Source object
public static boolean hasImageInputStream(javax.xml.transform.Source src)
src
- the Source object
public static void removeStreams(javax.xml.transform.Source src)
src
- the Source objectpublic static void closeQuietly(javax.xml.transform.Source src)
src
- the Source objectpublic static javax.imageio.stream.ImageInputStream ignoreFlushing(javax.imageio.stream.ImageInputStream in)
in
- the ImageInputStream
public static boolean isGZIPCompressed(java.io.InputStream in) throws java.io.IOException
in
- the InputStream (must return true on markSupported())
java.io.IOException
- in case of an I/O errorpublic static java.io.InputStream decorateMarkSupported(java.io.InputStream in)
in
- the InputStream
public static java.io.InputStream autoDecorateInputStream(java.io.InputStream in) throws java.io.IOException
in
- the InputStream
java.io.IOException
- in case of an I/O errorpublic static java.util.Map getDefaultHints(ImageSessionContext session)
session
- the session context
public static java.lang.Integer getPageIndexFromURI(java.lang.String uri)
http://www.foo.bar/images/scan1.tif#page=4
(The method will return
3.)
If no page index information is found in the URI or if the URI cannot be parsed, the method returns null.
uri
- the URI that should be inspected
public static int needPageIndexFromURI(java.lang.String uri)
http://www.foo.bar/images/scan1.tif#page=4
(The method will return
3.)
If no page index information is found in the URI, the method just returns 0 which indicates the first page.
uri
- the URI that should be inspected
|
xmlgraphics-commons 1.3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |