com.bluecast.xml

Class XMLStreamReader

public final class XMLStreamReader extends XMLInputReader

A Reader for XML documents and streams. This class automatically determines the proper character set to use based on Byte Order Marks and XML declarations.

Version: $Revision: 1.7 $

Author: Yuval Oren, yuval@bluecast.com

Constructor Summary
XMLStreamReader()
Create an XMLStreamReader without providing an InputStream yet.
XMLStreamReader(InputStream in, boolean rewindDeclaration)
Creates an XMLStreamReader.
XMLStreamReader(InputStream in, String encoding, boolean rewindDeclaration)
Creates an XMLStreamReader while specifying a character encoding.
Method Summary
voidclose()
StringgetEncoding()
Returns the character set being used by the reader.
voidmark(int readAheadLimit)
booleanmarkSupported()
intread()
intread(char[] destbuf)
intread(char[] destbuf, int off, int len)
booleanready()
voidreset(InputStream in, String encoding, boolean rewindDeclaration)
Reuses this XMLStreamReader for a different InputStream.
voidreset()
longskip(long n)

Constructor Detail

XMLStreamReader

public XMLStreamReader()
Create an XMLStreamReader without providing an InputStream yet. You must call reset() before using.

XMLStreamReader

public XMLStreamReader(InputStream in, boolean rewindDeclaration)
Creates an XMLStreamReader.

Parameters: in the InputStream rewindDeclaration a value of false will skip past any XML declaration. True will dish out the entire document.

XMLStreamReader

public XMLStreamReader(InputStream in, String encoding, boolean rewindDeclaration)
Creates an XMLStreamReader while specifying a character encoding.

Method Detail

close

public void close()

getEncoding

public String getEncoding()
Returns the character set being used by the reader. Note that the encoding in the XML declaration is ignored if it is not needed to determine the character set.

mark

public void mark(int readAheadLimit)

markSupported

public boolean markSupported()

read

public int read()

read

public int read(char[] destbuf)

read

public int read(char[] destbuf, int off, int len)

ready

public boolean ready()

reset

public void reset(InputStream in, String encoding, boolean rewindDeclaration)
Reuses this XMLStreamReader for a different InputStream.

reset

public void reset()

skip

public long skip(long n)