/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
* THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
*/
/**
* Abstract decoder for developing concrete encoders.
*
* Concrete implementations extending Decoder will utilize methods on Decoder
* to decode XML infoset according to the Fast Infoset standard. It is the
* responsibility of the concrete implementation to ensure that methods are
* invoked in the correct order to correctly decode a valid fast infoset
* document.
*
* <p>
* This class extends org.sax.xml.DefaultHandler so that concrete SAX
* implementations can be used with javax.xml.parsers.SAXParser and the parse
* methods that take org.sax.xml.DefaultHandler as a parameter.
*
* <p>
* Buffering of octets that are read from an {@link java.io.InputStream} is
* supported in a similar manner to a {@link java.io.BufferedInputStream}.
* Combining buffering with decoding enables better performance.
*
* <p>
* More than one fast infoset document may be decoded from the
* {@link java.io.InputStream}.
*/
private static final char[] XML_NAMESPACE_NAME_CHARS =
private static final char[] XMLNS_NAMESPACE_PREFIX_CHARS =
private static final char[] XMLNS_NAMESPACE_NAME_CHARS =
/**
* String interning system property.
*/
"com.sun.xml.internal.fastinfoset.parser.string-interning";
/**
* Internal buffer size interning system property.
*/
"com.sun.xml.internal.fastinfoset.parser.buffer-size";
private static boolean _stringInterningSystemDefault = false;
static {
try {
if (i > 0) {
}
} catch (NumberFormatException e) {
}
}
/**
* True if string interning is performed by the decoder.
*/
/**
* The input stream from which the fast infoset document is being read.
*/
/**
* The map of URIs to referenced vocabularies.
*/
/**
* True if can parse fragments.
*/
protected boolean _parseFragments;
/**
* True if needs to close underlying input stream.
*/
protected boolean _needForceStreamClose;
/**
* True if the vocabulary is internally created by decoder.
*/
private boolean _vIsInternal;
/**
* The list of Notation Information Items that are part of the
* Document Information Item.
*/
/**
* The list of Unparsed Entity Information Items that are part of the
* Document Information Item.
*/
/**
* The map of URIs to registered encoding algorithms.
*/
/**
* The vocabulary used for decoding.
*/
/**
* The prefix table of the vocabulary.
*/
/**
* The element name table of the vocabulary.
*/
/**
* The attribute name table of the vocabulary.
*/
/**
* The character content chunk table of the vocabulary.
*/
/**
* The attribute value table of the vocabulary.
*/
/**
* The current octet that is being read
*/
protected int _b;
/**
* True if an information item is terminated.
*/
protected boolean _terminate;
/**
* True if two information item are terminated in direct sequence.
*/
protected boolean _doubleTerminate;
/**
* True if an entry is required to be added to a table
*/
protected boolean _addToTable;
/**
* The vocabulary table index to an indexed non identifying string.
*/
protected int _integer;
/**
* The vocabulary table index of identifying string or the identifier of
* an encoding algorithm or restricted alphabet.
*/
protected int _identifier;
/**
* The size of the internal buffer.
*/
/**
* The internal buffer used for decoding.
*/
/**
* A mark into the internal buffer used for decoding encoded algorithm
* or restricted alphabet data.
*/
protected int _octetBufferStart;
/**
* The offset into the buffer to read the next byte.
*/
protected int _octetBufferOffset;
/**
* The end of the buffer.
*/
protected int _octetBufferEnd;
/**
* The length of some octets in the buffer that are to be read.
*/
protected int _octetBufferLength;
/**
* The internal buffer of characters.
*/
/**
* The length of characters in the buffer of characters.
*/
protected int _charBufferLength;
/**
* Helper class that checks for duplicate attribute information items.
*/
protected DuplicateAttributeVerifier _duplicateAttributeVerifier = new DuplicateAttributeVerifier();
/**
* Default constructor for the Decoder.
*/
protected Decoder() {
_v = new ParserVocabulary();
_vIsInternal = true;
}
// FastInfosetParser interface
/**
* {@inheritDoc}
*/
}
/**
* {@inheritDoc}
*/
public boolean getStringInterning() {
return _stringInterning;
}
/**
* {@inheritDoc}
*/
}
}
/**
* {@inheritDoc}
*/
public int getBufferSize() {
return _bufferSize;
}
/**
* {@inheritDoc}
*/
if (_registeredEncodingAlgorithms == null) {
_registeredEncodingAlgorithms = new HashMap();
}
}
/**
* {@inheritDoc}
*/
return _registeredEncodingAlgorithms;
}
/**
* {@inheritDoc}
*/
if (referencedVocabualries != null) {
// Clone the input map
_externalVocabularies = new HashMap();
} else {
}
}
/**
* {@inheritDoc}
*/
return _externalVocabularies;
}
/**
* {@inheritDoc}
*/
}
/**
* {@inheritDoc}
*/
public boolean getParseFragments() {
return _parseFragments;
}
/**
* {@inheritDoc}
*/
}
/**
* {@inheritDoc}
*/
public boolean getForceStreamClose() {
return _needForceStreamClose;
}
// End FastInfosetParser interface
/**
* Reset the decoder for reuse decoding another XML infoset.
*/
public void reset() {
_terminate = _doubleTerminate = false;
}
/**
* Set the ParserVocabulary to be used for decoding.
*
* @param v the vocabulary to be used for decoding.
*/
_v = v;
_vIsInternal = false;
}
/**
* Set the InputStream to decode the fast infoset document.
*
* @param s the InputStream where the fast infoset document is decoded from.
*/
_s = s;
_octetBufferOffset = 0;
_octetBufferEnd = 0;
if (_vIsInternal == true) {
}
}
final int b = read();
if (b == EncodingConstants.DOCUMENT_INITIAL_VOCABULARY_FLAG) {
} else if (b != 0) {
getString("message.optinalValues"));
}
}
final int noOfItems = decodeNumberOfItemsOfSequence();
for (int i = 0; i < noOfItems; i++) {
}
}
// First 5 optionals of 13 bit optional field
int b = read();
// Next 8 optionals of 13 bit optional field
// Optimize for the most common case
return;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
if (_externalVocabularies == null) {
throw new IOException(CommonResourceBundle.
}
if (o instanceof ParserVocabulary) {
(ParserVocabulary)o, false);
pv, false);
} else {
getString("message.externalVocabularyNotRegistered",
new Object[]{externalVocabularyURI}));
}
}
final int noOfItems = decodeNumberOfItemsOfSequence();
for (int i = 0; i < noOfItems; i++) {
}
}
final int noOfItems = decodeNumberOfItemsOfSequence();
for (int i = 0; i < noOfItems; i++) {
}
}
private void decodeTableItems(ContiguousCharArrayArray array) throws FastInfosetException, IOException {
final int noOfItems = decodeNumberOfItemsOfSequence();
for (int i = 0; i < noOfItems; i++) {
switch(decodeNonIdentifyingStringOnFirstBit()) {
case NISTRING_STRING:
break;
default:
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.illegalState"));
}
}
}
final int noOfItems = decodeNumberOfItemsOfSequence();
for (int i = 0; i < noOfItems; i++) {
switch(decodeNonIdentifyingStringOnFirstBit()) {
case NISTRING_STRING:
break;
default:
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.illegalState"));
}
}
}
private void decodeTableItems(QualifiedNameArray array, boolean isAttribute) throws FastInfosetException, IOException {
final int noOfItems = decodeNumberOfItemsOfSequence();
for (int i = 0; i < noOfItems; i++) {
final int b = read();
int prefixIndex = -1;
}
int namespaceNameIndex = -1;
}
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.missingNamespace"));
}
final int localNameIndex = decodeIntegerIndexOnSecondBit();
if (isAttribute) {
}
}
}
final int b = read();
if (b < 128) {
return b + 1;
} else {
}
}
if (_notations == null) {
_notations = new ArrayList();
} else {
_notations.clear();
}
int b = read();
b = read();
}
if (b != EncodingConstants.TERMINATOR) {
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.IIsNotTerminatedCorrectly"));
}
}
if (_unparsedEntities == null) {
_unparsedEntities = new ArrayList();
} else {
}
int b = read();
UnparsedEntity unparsedEntity = new UnparsedEntity(name, system_identifier, public_identifier, notation_name);
b = read();
}
if (b != EncodingConstants.TERMINATOR) {
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.unparsedEntities"));
}
}
}
switch(decodeNonIdentifyingStringOnFirstBit()) {
case NISTRING_STRING:
if (_addToTable) {
}
return data;
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingNotSupported"));
case NISTRING_INDEX:
case NISTRING_EMPTY_STRING:
default:
return "";
}
}
}
int i;
// EII large index
} else {
// EII large large index
i = (((read() & EncodingConstants.INTEGER_3RD_BIT_LARGE_LARGE_MASK) << 16) | (read() << 8) | read())
}
}
throws FastInfosetException, IOException {
if (q == null) q = new QualifiedName();
switch (state) {
// no prefix, no namespace
case 0:
return q.set(
"",
"",
-1,
-1,
null);
// no prefix, namespace
case 1:
return q.set(
"",
-1,
null);
// prefix, no namespace
case 2:
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.qNameMissingNamespaceName"));
// prefix, namespace
case 3:
return q.set(
default:
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingEII"));
}
}
/*
* C.14
* decodeNonIdentifyingStringOnFirstBit
*/
protected final int decodeNonIdentifyingStringOnFirstBit() throws FastInfosetException, IOException {
final int b = read();
switch(DecoderStateTables.NISTRING(b)) {
return NISTRING_STRING;
return NISTRING_STRING;
{
(read() << 16) |
(read() << 8) |
read();
return NISTRING_STRING;
}
return NISTRING_STRING;
return NISTRING_STRING;
{
(read() << 16) |
(read() << 8) |
read();
return NISTRING_STRING;
}
{
// Decode resitricted alphabet integer
return NISTRING_STRING;
}
{
// Decode encoding algorithm integer
return NISTRING_ENCODING_ALGORITHM;
}
return NISTRING_INDEX;
return NISTRING_INDEX;
return NISTRING_INDEX;
return NISTRING_EMPTY_STRING;
default:
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingNonIdentifyingString"));
}
}
protected final void decodeOctetsOnFifthBitOfNonIdentifyingStringOnFirstBit(int b) throws FastInfosetException, IOException {
// Remove top 4 bits of restricted alphabet or encoding algorithm integer
b &= 0x0F;
// Reuse UTF8 length states
switch(DecoderStateTables.NISTRING(b)) {
_octetBufferLength = b + 1;
break;
break;
(read() << 16) |
(read() << 8) |
read();
break;
default:
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingOctets"));
}
}
protected final void decodeOctetsOnSeventhBitOfNonIdentifyingStringOnThirdBit(int b) throws FastInfosetException, IOException {
// Remove top 6 bits of restricted alphabet or encoding algorithm integer
switch (b & 0x03) {
// Small length
case 0:
_octetBufferLength = 1;
break;
// Small length
case 1:
_octetBufferLength = 2;
break;
// Medium length
case 2:
break;
// Large length
case 3:
(read() << 16) |
(read() << 8) |
read();
break;
}
}
/*
* C.13
*/
protected final String decodeIdentifyingNonEmptyStringOnFirstBit(StringArray table) throws FastInfosetException, IOException {
final int b = read();
switch(DecoderStateTables.ISTRING(b)) {
{
_octetBufferLength = b + 1;
final String s = (_stringInterning) ? decodeUtf8StringAsString().intern() : decodeUtf8StringAsString();
return s;
}
{
final String s = (_stringInterning) ? decodeUtf8StringAsString().intern() : decodeUtf8StringAsString();
return s;
}
{
(read() << 16) |
(read() << 8) |
read();
final String s = (_stringInterning) ? decodeUtf8StringAsString().intern() : decodeUtf8StringAsString();
return s;
}
default:
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingIdentifyingString"));
}
}
protected int _prefixIndex;
/*
* C.13
*/
protected final String decodeIdentifyingNonEmptyStringOnFirstBitAsPrefix(boolean namespaceNamePresent) throws FastInfosetException, IOException {
final int b = read();
switch(DecoderStateTables.ISTRING_PREFIX_NAMESPACE(b)) {
{
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.prefixIllegal"));
}
return s;
}
{
}
return s;
}
{
_octetBufferLength = b + 1;
final String s = (_stringInterning) ? decodeUtf8StringAsString().intern() : decodeUtf8StringAsString();
return s;
}
{
final String s = (_stringInterning) ? decodeUtf8StringAsString().intern() : decodeUtf8StringAsString();
return s;
}
{
(read() << 16) |
(read() << 8) |
read();
final String s = (_stringInterning) ? decodeUtf8StringAsString().intern() : decodeUtf8StringAsString();
return s;
}
if (namespaceNamePresent) {
_prefixIndex = 0;
// Peak at next byte and check the index of the XML namespace name
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.wrongNamespaceName"));
}
} else {
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.missingNamespaceName"));
}
_prefixIndex = (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
default:
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingIdentifyingStringForPrefix"));
}
}
/*
* C.13
*/
protected final String decodeIdentifyingNonEmptyStringIndexOnFirstBitAsPrefix(boolean namespaceNamePresent) throws FastInfosetException, IOException {
final int b = read();
switch(DecoderStateTables.ISTRING_PREFIX_NAMESPACE(b)) {
if (namespaceNamePresent) {
_prefixIndex = 0;
// Peak at next byte and check the index of the XML namespace name
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.wrongNamespaceName"));
}
} else {
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.missingNamespaceName"));
}
_prefixIndex = (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
default:
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingIdentifyingStringForPrefix"));
}
}
protected int _namespaceNameIndex;
/*
* C.13
*/
protected final String decodeIdentifyingNonEmptyStringOnFirstBitAsNamespaceName(boolean prefixPresent) throws FastInfosetException, IOException {
final int b = read();
switch(DecoderStateTables.ISTRING_PREFIX_NAMESPACE(b)) {
{
_octetBufferLength = b + 1;
final String s = (_stringInterning) ? decodeUtf8StringAsString().intern() : decodeUtf8StringAsString();
return s;
}
{
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.xmlnsConnotBeBoundToPrefix"));
}
return s;
}
{
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.illegalNamespaceName"));
}
return s;
}
{
final String s = (_stringInterning) ? decodeUtf8StringAsString().intern() : decodeUtf8StringAsString();
return s;
}
{
(read() << 16) |
(read() << 8) |
read();
final String s = (_stringInterning) ? decodeUtf8StringAsString().intern() : decodeUtf8StringAsString();
return s;
}
if (prefixPresent) {
_namespaceNameIndex = 0;
return EncodingConstants.XML_NAMESPACE_NAME;
} else {
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.namespaceWithoutPrefix"));
}
_namespaceNameIndex = (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
default:
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingForNamespaceName"));
}
}
/*
* C.13
*/
protected final String decodeIdentifyingNonEmptyStringIndexOnFirstBitAsNamespaceName(boolean prefixPresent) throws FastInfosetException, IOException {
final int b = read();
switch(DecoderStateTables.ISTRING_PREFIX_NAMESPACE(b)) {
if (prefixPresent) {
_namespaceNameIndex = 0;
return EncodingConstants.XML_NAMESPACE_NAME;
} else {
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.namespaceWithoutPrefix"));
}
_namespaceNameIndex = (((b & EncodingConstants.INTEGER_2ND_BIT_LARGE_MASK) << 16) | (read() << 8) | read())
default:
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingForNamespaceName"));
}
}
private boolean compareCharsWithCharBufferFromEndToStart(char[] c) {
int i = _charBufferLength ;
while (--i >= 0) {
if (c[i] != _charBuffer[i]) {
return false;
}
}
return true;
}
/*
* C.22
*/
protected final String decodeNonEmptyOctetStringOnSecondBitAsUtf8String() throws FastInfosetException, IOException {
}
/*
* C.22
*/
protected final void decodeNonEmptyOctetStringOnSecondBitAsUtf8CharArray() throws FastInfosetException, IOException {
}
/*
* C.22
*/
protected final void decodeNonEmptyOctetStringLengthOnSecondBit() throws FastInfosetException, IOException {
final int b = read();
switch(DecoderStateTables.ISTRING(b)) {
_octetBufferLength = b + 1;
break;
break;
{
(read() << 16) |
(read() << 8) |
read();
break;
}
default:
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingNonEmptyOctet"));
}
}
/*
* C.25
*/
final int b = read() | 0x80;
switch(DecoderStateTables.ISTRING(b)) {
return b & EncodingConstants.INTEGER_2ND_BIT_SMALL_MASK;
default:
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.decodingIndexOnSecondBit"));
}
}
if (!_isFastInfosetDocument()) {
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.notFIDocument"));
}
}
protected final void decodeRestrictedAlphabetAsCharBuffer() throws FastInfosetException, IOException {
// decodeAlphabetOctetsAsCharBuffer(BuiltInRestrictedAlphabets.table[_identifier]);
CharArray ca = _v.restrictedAlphabet.get(_identifier - EncodingConstants.RESTRICTED_ALPHABET_APPLICATION_START);
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.alphabetNotPresent", new Object[]{Integer.valueOf(_identifier)}));
}
} else {
// Reserved built-in algorithms for future use
// TODO should use sax property to decide if event will be
// reported, allows for support through handler if required.
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.alphabetIdentifiersReserved"));
}
}
protected final String decodeRestrictedAlphabetAsString() throws FastInfosetException, IOException {
}
protected final String decodeRAOctetsAsString(char[] restrictedAlphabet) throws FastInfosetException, IOException {
}
protected final void decodeFourBitAlphabetOctetsAsCharBuffer(char[] restrictedAlphabet) throws FastInfosetException, IOException {
_charBufferLength = 0;
_charBuffer = new char[characters];
}
int v = 0;
}
v &= 0x0F;
if (v != 0x0F) {
}
}
protected final void decodeAlphabetOctetsAsCharBuffer(char[] restrictedAlphabet) throws FastInfosetException, IOException {
throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.alphabetMustContain2orMoreChars"));
}
int bitsPerCharacter = 1;
}
if (characters == 0) {
throw new IOException("");
}
_charBufferLength = 0;
_charBuffer = new char[characters];
}
resetBits();
for (int i = 0; i < characters; i++) {
throw new FastInfosetException(CommonResourceBundle.getInstance().getString("message.alphabetIncorrectlyTerminated"));
}
break;
}
}
}
private int _bitsLeftInOctet;
private void resetBits() {
_bitsLeftInOctet = 0;
}
int value = 0;
while (bits > 0) {
if (_bitsLeftInOctet == 0) {
_bitsLeftInOctet = 8;
}
}
return value;
}
}
}
}
}
}
// Length to read is too large, resize the buffer
byte[] newOctetBuffer = new byte[_octetBufferLength];
// Move partially read octets to the start of the buffer
} else {
// Move partially read octets to the start of the buffer
}
_octetBufferOffset = 0;
// Read as many octets as possible to fill the buffer
if (octetsRead < 0) {
throw new EOFException("Unexpeceted EOF");
}
// Check if the number of octets that have been read is not enough
// This can happen when underlying non-blocking is used to read
if (_octetBufferEnd < _octetBufferLength) {
repeatedRead();
}
}
}
// Check if the number of octets that have been read is not enough
while (_octetBufferEnd < _octetBufferLength) {
// Read as many octets as possible to fill the buffer
final int octetsRead = _s.read(_octetBuffer, _octetBufferEnd, _octetBuffer.length - _octetBufferEnd);
if (octetsRead < 0) {
throw new EOFException("Unexpeceted EOF");
}
}
}
_charBuffer = new char[_octetBufferLength];
}
_charBufferLength = 0;
int b1;
while (end != _octetBufferOffset) {
} else {
}
}
}
int b1;
while (end != _octetBufferOffset) {
} else {
}
}
}
{
// Decode byte 2
if (end == _octetBufferOffset) {
}
}
// Character guaranteed to be in [0x20, 0xD7FF] range
// since a character encoded in two bytes will be in the
// range [0x80, 0x1FFF]
_charBuffer[_charBufferLength++] = (char) (
| (b2 & 0x3F));
break;
}
_charBuffer[_charBufferLength++] = c;
} else {
}
break;
{
} else {
}
break;
}
default:
}
}
{
// Decode byte 2
if (end == _octetBufferOffset) {
}
}
// Character guaranteed to be in [0x20, 0xD7FF] range
// since a character encoded in two bytes will be in the
// range [0x80, 0x1FFF]
ch[_charBufferLength++] = (char) (
| (b2 & 0x3F));
break;
}
ch[_charBufferLength++] = c;
} else {
}
break;
{
} else {
}
break;
}
default:
}
}
_charBufferLength = 0;
_charBuffer = new char[_octetBufferLength];
}
} else {
}
while (end != _octetBufferOffset) {
} else {
}
}
}
{
// Decode byte 2
if (end == _octetBufferOffset) {
}
}
final char c = (char) (
| (b2 & 0x3F));
if (XMLChar.isNCNameStart(c)) {
_charBuffer[_charBufferLength++] = c;
} else {
}
break;
}
if (XMLChar.isNCNameStart(c)) {
_charBuffer[_charBufferLength++] = c;
} else {
}
break;
{
} else {
}
break;
}
default:
}
}
{
// Decode byte 2
if (end == _octetBufferOffset) {
}
}
final char c = (char) (
| (b2 & 0x3F));
_charBuffer[_charBufferLength++] = c;
} else {
}
break;
}
_charBuffer[_charBufferLength++] = c;
} else {
}
break;
{
} else {
}
break;
}
default:
}
}
// Decode byte 2
if (end == _octetBufferOffset) {
}
}
// Decode byte 3
if (end == _octetBufferOffset) {
}
}
return (char) (
| (b3 & 0x3F));
}
private char _utf8_highSurrogate;
private char _utf8_lowSurrogate;
// Decode byte 2
if (end == _octetBufferOffset) {
}
}
// Decode byte 3
if (end == _octetBufferOffset) {
}
}
// Decode byte 4
if (end == _octetBufferOffset) {
}
}
if (uuuuu > 0x10) {
}
_utf8_highSurrogate = (char) (0xD800 |
}
}
}
}
_charBuffer = new char[_charBufferLength];
}
for (int i = 0; i < _charBufferLength; i++) {
// TODO check c is a valid Char character
_charBuffer[i] = c;
}
}
}
} else {
b.append(':');
return b.toString();
}
}
if (_octetBufferOffset < _octetBufferEnd) {
} else {
if (_octetBufferEnd < 0) {
}
_octetBufferOffset = 1;
}
}
}
}
}
if (_octetBufferOffset < _octetBufferEnd) {
} else {
if (octetBufferListener != null) {
}
if (_octetBufferEnd < 0) {
}
_octetBufferOffset = 0;
}
}
} else {
if (octetBufferListener != null) {
}
int offset = 0;
if (_octetBufferOffset < _octetBufferEnd) {
offset = 1;
}
if (_octetBufferEnd < 0) {
}
_octetBufferOffset = 0;
}
}
if (_octetBufferStart < _octetBufferOffset) {
} else {
return -1;
}
}
}
if (b == null) {
throw new NullPointerException();
throw new IndexOutOfBoundsException();
} else if (len == 0) {
return 0;
}
if (newOctetBufferStart < _octetBufferOffset) {
return len;
} else if (_octetBufferStart < _octetBufferOffset) {
return bytesToRead;
} else {
return -1;
}
}
}
// Fill up the octet buffer
peek();
// Check for binary header
// Check for each form of XML declaration
// Check XML declaration
// Check for binary header
return false;
} else {
// Fast Infoset document with XML declaration and binary header
return true;
}
}
}
return false;
}
// Fast Infoset document with binary header
return true;
}
for (int i = 0; i < length; i++) {
return false;
}
}
return true;
}
// TODO
// Check for <?xml declaration with 'finf' encoding
final byte[] header = new byte[4];
return false;
}
// TODO
return true;
}
}