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
public class XMLWrapperStream extends InputStream
This class serves to provide an InputStream for an XML fragment (e.g., embedded XMP metadata).- Author:
- Gary McGath
-
-
Constructor Summary
Constructors Constructor Description XMLWrapperStream(InputStream wrappedStream)Constructor.XMLWrapperStream(InputStream wrappedStream, String rootName)Constructor.XMLWrapperStream(InputStream wrappedStream, String rootName, String version, String encoding, String standalone)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intread()Get a byte.-
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
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
public XMLWrapperStream(InputStream wrappedStream)
Constructor. Equivalent toXMLWrapperStream (wrappedStream, null, null, null, null)- Parameters:
wrappedStream- The stream which this stream will subsume.
-
XMLWrapperStream
public XMLWrapperStream(InputStream wrappedStream, String rootName)
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 Detail
-
read
public int read() throws IOExceptionGet a byte. Successive calls will return the XML declaration, then the wrapped stream.- Specified by:
readin classInputStream- Throws:
IOException- See Also:
InputStream.read()
-
-