edu.harvard.hul.ois.jhove.module.xml
Class XmlDeclStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by edu.harvard.hul.ois.jhove.module.xml.XmlDeclStream
All Implemented Interfaces:
java.io.Closeable

public class XmlDeclStream
extends java.io.FilterInputStream

This class is layered under the InputSource for the XmlModule so that it can detect an XML declaration and character references, which aren't reported by other API's. This is called XmlDeclStream for historical reasons, though it's no longer limited to that function.

Author:
Gary McGath

Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
XmlDeclStream(java.io.InputStream strm)
           
 
Method Summary
 java.util.List getCharacterReferences()
          Returns the character references as a List of Integers.
 java.lang.String getEncoding()
          Returns the encoding string.
 java.lang.String getStandalone()
          Returns the standalone string.
 java.lang.String getVersion()
          Returns the version string.
 int read()
          Reads the next byte of data from this input stream.
 int read(byte[] b)
          Reads up to byte.length bytes of data from this input stream into an array of bytes.
 int read(byte[] b, int off, int len)
          Reads up to len bytes of data from this input stream into an array of bytes.
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlDeclStream

public XmlDeclStream(java.io.InputStream strm)
Method Detail

read

public int read()
         throws java.io.IOException
Reads the next byte of data from this input stream. Processes bytes as it reads them.

Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException

read

public int read(byte[] b)
         throws java.io.IOException
Reads up to byte.length bytes of data from this input stream into an array of bytes. Processes bytes as it reads them.

Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Reads up to len bytes of data from this input stream into an array of bytes. Processes bytes as it reads them.

Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException

getCharacterReferences

public java.util.List getCharacterReferences()
Returns the character references as a List of Integers. No sorting or elimination of duplicates is done; this is just all the character references in the order they occurred.


getVersion

public java.lang.String getVersion()
Returns the version string. May be null (though it shouldn't be in well-formed XML).


getEncoding

public java.lang.String getEncoding()
Returns the encoding string. May be null.


getStandalone

public java.lang.String getStandalone()
Returns the standalone string. May be null.