Open SiteSearch 4.1.1
Final

ORG.oclc.xml.util
Class XMLInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--ORG.oclc.xml.util.XMLInputStream

public class XMLInputStream
extends InputStream

A Reader specifically for dealing with different encoding formats as well as liitleendian files.


Field Summary
 boolean caseInsensitive
          Whether the document to be parsed caseInsensitive.
 
Constructor Summary
XMLInputStream(InputStream in)
          Builds the XMLInputStream.
XMLInputStream(URL url)
          Builds the XMLInputStream.
 
Method Summary
 void close()
          Close the stream and release system resources.
 XMLOutputStream createOutputStream(OutputStream out)
          Creates a new XMLOutputStream with the proper initial state.
 int read()
          Returns the next unicode char in the stream.
 void setEncoding(String encoding)
          Defines the character encoding of the stream.
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

caseInsensitive

public boolean caseInsensitive
Whether the document to be parsed caseInsensitive. (if so, all names are folded to upper case). Default is 'false'.
Constructor Detail

XMLInputStream

public XMLInputStream(URL url)
               throws IOException
Builds the XMLInputStream. This constructor is intended to be called on Windows to speed up input speed. The decoding is done by IXMLStream Note: This constructor relies on CXMLStream class in xmlurlstream.dll. If xmlurlstream.dll or xmlurlstream.tlb is not properly registered on the system, or the encoding of the input stream cannot be handled, this constructor throws an IOException

XMLInputStream

public XMLInputStream(InputStream in)
Builds the XMLInputStream. Reads the first four bytes of the InputStream in order to make a guess as to the character encoding of the file. Assumes that the document is following the XML standard and that any non-UTF-8 file will begin with a tag.
Method Detail

read

public int read()
         throws IOException
Returns the next unicode char in the stream. The read done depends on the current readState. POP states imply that there are characters that have been pushed onto the next[] stack.
Overrides:
read in class InputStream

setEncoding

public void setEncoding(String encoding)
                 throws IOException
Defines the character encoding of the stream. The new character encoding must agree with the encoding determined by the constructer. setEncoding is used to clarify between encodings that are not fully determinable through the first four bytes in a stream and not to change the encoding. This method must be called within 4096 reads() after construction.

createOutputStream

public XMLOutputStream createOutputStream(OutputStream out)
Creates a new XMLOutputStream with the proper initial state. XMLOutputStreams should always be created through this method if the output stream is to mimic this input stream.

close

public void close()
           throws IOException
Close the stream and release system resources.
Overrides:
close in class InputStream

Open SiteSearch 4.1.1
Final