com.bluecast.xml
Class XMLReaderReader

java.lang.Object
  extended byjava.io.Reader
      extended bycom.bluecast.xml.XMLInputReader
          extended bycom.bluecast.xml.XMLReaderReader

public final class XMLReaderReader
extends XMLInputReader

A Reader for XML documents and streams. This class prepares a Reader source for XML processing by converting CR/LF patterns to LF and by checking for illegal XML characters.

Version:
$Revision: 1.5 $
Author:
Yuval Oren, yuval@bluecast.com

Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
XMLReaderReader()
          Create an XMLReaderReader without providing an input Reader yet.
XMLReaderReader(java.io.Reader in)
          Creates an XMLReaderReader and resets the reader position after reading the XML declaration.
XMLReaderReader(java.io.Reader in, boolean rewindDeclaration)
          Creates an XMLReaderReader.
 
Method Summary
 void close()
           
 void mark(int readAheadLimit)
           
 boolean markSupported()
           
 int read()
           
 int read(char[] destbuf)
           
 int read(char[] destbuf, int off, int len)
           
 boolean ready()
           
 void reset()
           
 void reset(java.io.Reader in, boolean rewindDeclaration)
           
 long skip(long n)
           
 
Methods inherited from class com.bluecast.xml.XMLInputReader
getXMLDeclaredEncoding, getXMLVersion, isXMLStandalone, isXMLStandaloneDeclared, parseXMLDeclaration, resetInput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLReaderReader

public XMLReaderReader()
Create an XMLReaderReader without providing an input Reader yet. You must call reset() before using.


XMLReaderReader

public XMLReaderReader(java.io.Reader in)
                throws java.io.IOException
Creates an XMLReaderReader and resets the reader position after reading the XML declaration.

Parameters:
in - the input source

XMLReaderReader

public XMLReaderReader(java.io.Reader in,
                       boolean rewindDeclaration)
                throws java.io.IOException
Creates an XMLReaderReader.

Parameters:
in - the input source
rewindDeclaration - a value of false will skip past any XML declaration. True will dish out the entire document.
Method Detail

reset

public void reset(java.io.Reader in,
                  boolean rewindDeclaration)
           throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

mark

public void mark(int readAheadLimit)
          throws java.io.IOException
Throws:
java.io.IOException

markSupported

public boolean markSupported()

read

public int read()
         throws java.io.IOException
Throws:
java.io.IOException

read

public int read(char[] destbuf)
         throws java.io.IOException
Throws:
java.io.IOException

read

public int read(char[] destbuf,
                int off,
                int len)
         throws java.io.IOException
Throws:
java.io.IOException

ready

public boolean ready()
              throws java.io.IOException
Throws:
java.io.IOException

reset

public void reset()
           throws java.io.IOException
Throws:
java.io.IOException

skip

public long skip(long n)
          throws java.io.IOException
Throws:
java.io.IOException