com.bluecast.xml

Class ASCIIXMLDecoder

Implemented Interfaces:
CharsetDecoder, XMLDecoder

public final class ASCIIXMLDecoder
extends java.lang.Object
implements XMLDecoder

A decoder for ASCII XML. Also converts carriage returns into linefeeds and CRLF to LF. Checks for invalid XML characters.
Version:
$Revision: 1.5 $
Author:
Yuval Oren, yuval@bluecast.com

Method Summary

void
decode(byte[] in_buf, int in_off, int in_len, char[] out_buf, int out_off, int out_len, int[] result)
Decodes an array of bytes into characters.
void
decodeXMLDecl(byte[] in_buf, int in_off, int in_len, char[] out_buf, int out_off, int out_len, int[] result)
int
maxBytesPerChar()
Minimum number of characters produced per byte using this decoder.
int
minBytesPerChar()
Minimum number of characters produced per byte using this decoder.
CharsetDecoder
newCharsetDecoder()
XMLDecoder
newXMLDecoder()
void
reset()

Method Details

decode

public void decode(byte[] in_buf,
                   int in_off,
                   int in_len,
                   char[] out_buf,
                   int out_off,
                   int out_len,
                   int[] result)
            throws CharConversionException
Decodes an array of bytes into characters.
Specified by:
decode in interface CharsetDecoder
Parameters:
in_buf - input byte buffer
in_off - starting byte buffer offset
in_len - max number of bytes to read
out_buf - output character buffer
out_off - char buffer offset at which to start writing
out_len - max number of chars to write
result - an array of size >= 2 where results are returned: result[0] = number of bytes read. result[1] = number of chars written

decodeXMLDecl

public void decodeXMLDecl(byte[] in_buf,
                          int in_off,
                          int in_len,
                          char[] out_buf,
                          int out_off,
                          int out_len,
                          int[] result)
            throws CharConversionException
Specified by:
decodeXMLDecl in interface XMLDecoder

maxBytesPerChar

public int maxBytesPerChar()
Minimum number of characters produced per byte using this decoder.
Specified by:
maxBytesPerChar in interface CharsetDecoder

minBytesPerChar

public int minBytesPerChar()
Minimum number of characters produced per byte using this decoder.
Specified by:
minBytesPerChar in interface CharsetDecoder

newCharsetDecoder

public CharsetDecoder newCharsetDecoder()
Specified by:
newCharsetDecoder in interface CharsetDecoder

newXMLDecoder

public XMLDecoder newXMLDecoder()
Specified by:
newXMLDecoder in interface XMLDecoder

reset

public void reset()
Specified by:
reset in interface CharsetDecoder