edu.harvard.hul.ois.jhove
Class XMLWrapperStream

java.lang.Object
  extended by java.io.InputStream
      extended by edu.harvard.hul.ois.jhove.XMLWrapperStream
All Implemented Interfaces:
java.io.Closeable

public class XMLWrapperStream
extends java.io.InputStream

This class serves to provide an InputStream for an XML fragment (e.g., embedded XMP metadata).

Author:
Gary McGath

Constructor Summary
XMLWrapperStream(java.io.InputStream wrappedStream)
          Constructor.
XMLWrapperStream(java.io.InputStream wrappedStream, java.lang.String rootName)
          Constructor.
XMLWrapperStream(java.io.InputStream wrappedStream, java.lang.String rootName, java.lang.String version, java.lang.String encoding, java.lang.String standalone)
          Constructor.
 
Method Summary
 int read()
          Get a byte.
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLWrapperStream

public XMLWrapperStream(java.io.InputStream wrappedStream,
                        java.lang.String rootName,
                        java.lang.String version,
                        java.lang.String encoding,
                        java.lang.String standalone)
Constructor.

Parameters:
wrappedStream - The stream which this stream will subsume.
rootName - The name of the root element. May be null if wrappedStream already 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 the standalone attribute. May be null.

XMLWrapperStream

public XMLWrapperStream(java.io.InputStream wrappedStream)
Constructor. Equivalent to XMLWrapperStream (wrappedStream, null, null, null, null)

Parameters:
wrappedStream - The stream which this stream will subsume.

XMLWrapperStream

public XMLWrapperStream(java.io.InputStream wrappedStream,
                        java.lang.String rootName)
Constructor. Equivalent to XMLWrapperStream (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 java.io.IOException
Get a byte. Successive calls will return the XML declaration, then the wrapped stream.

Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException
See Also:
InputStream.read()