gnu.xml

Class XMLParserByte


public class XMLParserByte
extends java.lang.Object

Reads XML from a byte array. Assumes a state-less character encoding containing ascii as a sub-set, and where no byte in a multi-byte character is the same as a xml special character. Any bytes with high-order bit set are treated as if they are letters, and can be part of names. Handles CR/LF, CDATA, entity references, processing instructions, DOCTYPE, as well as the obvious (text, element, and attributes).

Field Summary

protected byte[]
buffer
protected InputStream
in
protected int
limit
protected int
pos

Constructor Summary

XMLParserByte(InputStream in, ParsedXMLHandlerByte out)
XMLParserByte(URL url, ParsedXMLHandlerByte out)
XMLParserByte(byte[] buffer, int pos, int limit, ParsedXMLHandlerByte out)

Method Summary

void
error(char severity, String message)
int
fill(byte[] buffer, int start, int pos)
Fill the buffer with more data.
void
parse()

Field Details

buffer

protected byte[] buffer

in

protected InputStream in

limit

protected int limit

pos

protected int pos

Constructor Details

XMLParserByte

public XMLParserByte(InputStream in,
                     ParsedXMLHandlerByte out)

XMLParserByte

public XMLParserByte(URL url,
                     ParsedXMLHandlerByte out)
            throws IOException

XMLParserByte

public XMLParserByte(byte[] buffer,
                     int pos,
                     int limit,
                     ParsedXMLHandlerByte out)

Method Details

error

public void error(char severity,
                  String message)

fill

public int fill(byte[] buffer,
                int start,
                int pos)
Fill the buffer with more data.
Parameters:
start - start of current token.
pos - index of current read position

parse

public void parse()