本文整理汇总了Java中com.sun.xml.internal.fastinfoset.org.apache.xerces.util.XMLChar.isContent方法的典型用法代码示例。如果您正苦于以下问题:Java XMLChar.isContent方法的具体用法?Java XMLChar.isContent怎么用?Java XMLChar.isContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.xml.internal.fastinfoset.org.apache.xerces.util.XMLChar
的用法示例。
在下文中一共展示了XMLChar.isContent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decodeTwoToFourByteUtf8Character
import com.sun.xml.internal.fastinfoset.org.apache.xerces.util.XMLChar; //导入方法依赖的package包/类
private void decodeTwoToFourByteUtf8Character(int b1, int end) throws IOException {
switch(DecoderStateTables.UTF8(b1)) {
case DecoderStateTables.UTF8_TWO_BYTES:
{
// Decode byte 2
if (end == _octetBufferOffset) {
decodeUtf8StringLengthTooSmall();
}
final int b2 = _octetBuffer[_octetBufferOffset++] & 0xFF;
if ((b2 & 0xC0) != 0x80) {
decodeUtf8StringIllegalState();
}
// 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) (
((b1 & 0x1F) << 6)
| (b2 & 0x3F));
break;
}
case DecoderStateTables.UTF8_THREE_BYTES:
final char c = decodeUtf8ThreeByteChar(end, b1);
if (XMLChar.isContent(c)) {
_charBuffer[_charBufferLength++] = c;
} else {
decodeUtf8StringIllegalState();
}
break;
case DecoderStateTables.UTF8_FOUR_BYTES:
{
final int supplemental = decodeUtf8FourByteChar(end, b1);
if (XMLChar.isContent(supplemental)) {
_charBuffer[_charBufferLength++] = _utf8_highSurrogate;
_charBuffer[_charBufferLength++] = _utf8_lowSurrogate;
} else {
decodeUtf8StringIllegalState();
}
break;
}
default:
decodeUtf8StringIllegalState();
}
}