Package edu.harvard.hul.ois.jhove
Class XMLWrapperStream
java.lang.Object
java.io.InputStream
edu.harvard.hul.ois.jhove.XMLWrapperStream
- All Implemented Interfaces:
Closeable,AutoCloseable
This class serves to provide an InputStream for an XML
fragment (e.g., embedded XMP metadata).
- Author:
- Gary McGath
-
Constructor Summary
ConstructorsConstructorDescriptionXMLWrapperStream(InputStream wrappedStream) Constructor.XMLWrapperStream(InputStream wrappedStream, String rootName) Constructor.XMLWrapperStream(InputStream wrappedStream, String rootName, String version, String encoding, String standalone) Constructor. -
Method Summary
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
XMLWrapperStream
public XMLWrapperStream(InputStream wrappedStream, String rootName, String version, String encoding, String standalone) Constructor.- Parameters:
wrappedStream- The stream which this stream will subsume.rootName- The name of the root element. May be null ifwrappedStreamalready contains a root element.version- The XML version. Should be null or "1.0" unless there's a really good reason.encoding- The name of the character encoding. May be null.standalone- The value of thestandaloneattribute. May be null.
-
XMLWrapperStream
Constructor. Equivalent toXMLWrapperStream (wrappedStream, null, null, null, null)- Parameters:
wrappedStream- The stream which this stream will subsume.
-
XMLWrapperStream
Constructor. Equivalent toXMLWrapperStream (wrappedStream, rootName, null, null, null)- Parameters:
wrappedStream- The stream which this stream will subsume.rootName- The name of the root element. May be null.
-
-
Method Details
-
read
Get a byte. Successive calls will return the XML declaration, then the wrapped stream.- Specified by:
readin classInputStream- Throws:
IOException- See Also:
-