Class XmlSourceUtil
java.lang.Object
org.apache.xmlgraphics.io.XmlSourceUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcloseQuietly(Source src) Closes the InputStreams or ImageInputStreams of Source objects.static InputStreamgetInputStream(Source src) Returns theInputStreamthat is backing the givenSourceobject.static booleanhasInputStream(Source src) Indicates whether the Source object has an InputStream instance.static booleanIndicates whether the Source object has a Reader instance.static InputStreamneedInputStream(Source src) Returns the InputStream of a Source object.static voidremoveStreams(Source src) Removes any references to InputStreams or Readers from the given Source to prohibit accidental/unwanted use by a component further downstream.
-
Method Details
-
getInputStream
Returns theInputStreamthat is backing the givenSourceobject.- Parameters:
src- is backed by anInputStream- Returns:
- the input stream
-
needInputStream
Returns the InputStream of a Source object. This method throws an IllegalArgumentException if there's no InputStream instance available from the Source object.- Parameters:
src- the Source object- Returns:
- the InputStream
-
hasReader
Indicates whether the Source object has a Reader instance.- Parameters:
src- the Source object- Returns:
- true if an Reader is available
-
removeStreams
Removes any references to InputStreams or Readers from the given Source to prohibit accidental/unwanted use by a component further downstream.- Parameters:
src- the Source object
-
closeQuietly
Closes the InputStreams or ImageInputStreams of Source objects. Any exception occurring while closing the stream is ignored.- Parameters:
src- the Source object
-
hasInputStream
Indicates whether the Source object has an InputStream instance.- Parameters:
src- the Source object- Returns:
- true if an InputStream is available
-