本文整理汇总了Java中com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmException类的典型用法代码示例。如果您正苦于以下问题:Java EncodingAlgorithmException类的具体用法?Java EncodingAlgorithmException怎么用?Java EncodingAlgorithmException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EncodingAlgorithmException类属于com.sun.xml.internal.org.jvnet.fastinfoset包,在下文中一共展示了EncodingAlgorithmException类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: processCIIEncodingAlgorithm
import com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmException; //导入依赖的package包/类
protected final void processCIIEncodingAlgorithm(boolean addToTable) throws FastInfosetException, IOException {
_algorithmData = _octetBuffer;
_algorithmDataOffset = _octetBufferStart;
_algorithmDataLength = _octetBufferLength;
_isAlgorithmDataCloned = false;
if (_algorithmId >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) {
_algorithmURI = _v.encodingAlgorithm.get(_algorithmId - EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START);
if (_algorithmURI == null) {
throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.URINotPresent", new Object[]{Integer.valueOf(_identifier)}));
}
} else if (_algorithmId > EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) {
// 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 EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.identifiers10to31Reserved"));
}
if (addToTable) {
convertEncodingAlgorithmDataToCharacters();
_characterContentChunkTable.add(_characters, _characters.length);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:StAXDocumentParser.java
示例2: convertEncodingAlgorithmDataToCharacters
import com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmException; //导入依赖的package包/类
protected String convertEncodingAlgorithmDataToCharacters(boolean isAttributeValue) throws FastInfosetException, IOException {
StringBuffer buffer = new StringBuffer();
if (_identifier < EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) {
Object array = BuiltInEncodingAlgorithmFactory.getAlgorithm(_identifier).
decodeFromBytes(_octetBuffer, _octetBufferStart, _octetBufferLength);
BuiltInEncodingAlgorithmFactory.getAlgorithm(_identifier).convertToCharacters(array, buffer);
} else if (_identifier == EncodingAlgorithmIndexes.CDATA) {
if (!isAttributeValue) {
// Set back buffer position to start of encoded string
_octetBufferOffset -= _octetBufferLength;
return decodeUtf8StringAsString();
}
throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.CDATAAlgorithmNotSupported"));
} else if (_identifier >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) {
final String URI = _v.encodingAlgorithm.get(_identifier - EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START);
final EncodingAlgorithm ea = (EncodingAlgorithm)_registeredEncodingAlgorithms.get(URI);
if (ea != null) {
final Object data = ea.decodeFromBytes(_octetBuffer, _octetBufferStart, _octetBufferLength);
ea.convertToCharacters(data, buffer);
} else {
throw new EncodingAlgorithmException(
CommonResourceBundle.getInstance().getString("message.algorithmDataCannotBeReported"));
}
}
return buffer.toString();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:DOMDocumentParser.java
示例3: convertEncodingAlgorithmDataToCharacters
import com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmException; //导入依赖的package包/类
protected final void convertEncodingAlgorithmDataToCharacters() throws FastInfosetException, IOException {
StringBuffer buffer = new StringBuffer();
if (_algorithmId == EncodingAlgorithmIndexes.BASE64) {
convertBase64AlorithmDataToCharacters(buffer);
} else if (_algorithmId < EncodingConstants.ENCODING_ALGORITHM_BUILTIN_END) {
Object array = BuiltInEncodingAlgorithmFactory.getAlgorithm(_algorithmId).
decodeFromBytes(_algorithmData, _algorithmDataOffset, _algorithmDataLength);
BuiltInEncodingAlgorithmFactory.getAlgorithm(_algorithmId).convertToCharacters(array, buffer);
} else if (_algorithmId == EncodingAlgorithmIndexes.CDATA) {
_octetBufferOffset -= _octetBufferLength;
decodeUtf8StringIntoCharBuffer();
_characters = _charBuffer;
_charactersOffset = 0;
return;
} else if (_algorithmId >= EncodingConstants.ENCODING_ALGORITHM_APPLICATION_START) {
final EncodingAlgorithm ea = (EncodingAlgorithm)_registeredEncodingAlgorithms.get(_algorithmURI);
if (ea != null) {
final Object data = ea.decodeFromBytes(_octetBuffer, _octetBufferStart, _octetBufferLength);
ea.convertToCharacters(data, buffer);
} else {
throw new EncodingAlgorithmException(
CommonResourceBundle.getInstance().getString("message.algorithmDataCannotBeReported"));
}
}
_characters = new char[buffer.length()];
buffer.getChars(0, buffer.length(), _characters, 0);
_charactersOffset = 0;
_charBufferLength = _characters.length;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:StAXDocumentParser.java
示例4: convertBase64AlorithmDataToCharacters
import com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmException; //导入依赖的package包/类
protected void convertBase64AlorithmDataToCharacters(StringBuffer buffer) throws EncodingAlgorithmException, IOException {
// How much new came data was serialized with prev. tale
int afterTaleOffset = 0;
if (base64TaleLength > 0) {
// Serialize tale left from prev. chunk
int bytesToCopy = Math.min(3 - base64TaleLength, _algorithmDataLength);
System.arraycopy(_algorithmData, _algorithmDataOffset, base64TaleBytes, base64TaleLength, bytesToCopy);
if (base64TaleLength + bytesToCopy == 3) {
base64DecodeWithCloning(buffer, base64TaleBytes, 0, 3);
} else if (!isBase64Follows()) {
// End of text was read to temp array
base64DecodeWithCloning(buffer, base64TaleBytes, 0, base64TaleLength + bytesToCopy);
return;
} else {
// If the end of chunk fit to tmp array, but next chunk is expected
base64TaleLength += bytesToCopy;
return;
}
afterTaleOffset = bytesToCopy;
base64TaleLength = 0;
}
int taleBytesRemaining = isBase64Follows() ? (_algorithmDataLength - afterTaleOffset) % 3 : 0;
if (_isAlgorithmDataCloned) {
base64DecodeWithoutCloning(buffer, _algorithmData, _algorithmDataOffset + afterTaleOffset,
_algorithmDataLength - afterTaleOffset - taleBytesRemaining);
} else {
base64DecodeWithCloning(buffer, _algorithmData, _algorithmDataOffset + afterTaleOffset,
_algorithmDataLength - afterTaleOffset - taleBytesRemaining);
}
if (taleBytesRemaining > 0) {
System.arraycopy(_algorithmData, _algorithmDataOffset + _algorithmDataLength - taleBytesRemaining,
base64TaleBytes, 0, taleBytesRemaining);
base64TaleLength = taleBytesRemaining;
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:41,代码来源:StAXDocumentParser.java
示例5: getPrimtiveLengthFromOctetLength
import com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmException; //导入依赖的package包/类
public final int getPrimtiveLengthFromOctetLength(int octetLength) throws EncodingAlgorithmException {
if (octetLength % FLOAT_SIZE != 0) {
throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
getString("message.lengthNotMultipleOfFloat", new Object[]{Integer.valueOf(FLOAT_SIZE)}));
}
return octetLength / FLOAT_SIZE;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:FloatEncodingAlgorithm.java
示例6: getPrimtiveLengthFromOctetLength
import com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmException; //导入依赖的package包/类
public int getPrimtiveLengthFromOctetLength(int octetLength) throws EncodingAlgorithmException {
if (octetLength % LONG_SIZE != 0) {
throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
getString("message.lengthNotMultipleOfLong", new Object[]{Integer.valueOf(LONG_SIZE)}));
}
return octetLength / LONG_SIZE;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:LongEncodingAlgorithm.java
示例7: getPrimtiveLengthFromOctetLength
import com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmException; //导入依赖的package包/类
public final int getPrimtiveLengthFromOctetLength(int octetLength) throws EncodingAlgorithmException {
if (octetLength % INT_SIZE != 0) {
throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
getString("message.lengthNotMultipleOfInt", new Object[]{Integer.valueOf(INT_SIZE)}));
}
return octetLength / INT_SIZE;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:IntEncodingAlgorithm.java
示例8: getPrimtiveLengthFromOctetLength
import com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmException; //导入依赖的package包/类
public final int getPrimtiveLengthFromOctetLength(int octetLength) throws EncodingAlgorithmException {
if (octetLength % (LONG_SIZE * 2) != 0) {
throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
getString("message.lengthNotMultipleOfUUID",new Object[]{Integer.valueOf(LONG_SIZE * 2)}));
}
return octetLength / LONG_SIZE;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:UUIDEncodingAlgorithm.java
示例9: getPrimtiveLengthFromOctetLength
import com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmException; //导入依赖的package包/类
public final int getPrimtiveLengthFromOctetLength(int octetLength) throws EncodingAlgorithmException {
if (octetLength % DOUBLE_SIZE != 0) {
throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
getString("message.lengthIsNotMultipleOfDouble", new Object[]{Integer.valueOf(DOUBLE_SIZE)}));
}
return octetLength / DOUBLE_SIZE;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:DoubleEncodingAlgorithm.java
示例10: decodeFromBytes
import com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmException; //导入依赖的package包/类
public final Object decodeFromBytes(byte[] b, int start, int length) throws EncodingAlgorithmException {
final int blength = getPrimtiveLengthFromOctetLength(length, b[start]);
boolean[] data = new boolean[blength];
decodeFromBytesToBooleanArray(data, 0, blength, b, start, length);
return data;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:BooleanEncodingAlgorithm.java
示例11: getPrimtiveLengthFromOctetLength
import com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmException; //导入依赖的package包/类
public int getPrimtiveLengthFromOctetLength(int octetLength, int firstOctet) throws EncodingAlgorithmException {
final int unusedBits = (firstOctet >> 4) & 0xFF;
if (octetLength == 1) {
if (unusedBits > 3) {
throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.unusedBits4"));
}
return 4 - unusedBits;
} else {
if (unusedBits > 7) {
throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.unusedBits8"));
}
return octetLength * 8 - 4 - unusedBits;
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:BooleanEncodingAlgorithm.java
示例12: getPrimtiveLengthFromOctetLength
import com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmException; //导入依赖的package包/类
public final int getPrimtiveLengthFromOctetLength(int octetLength) throws EncodingAlgorithmException {
if (octetLength % SHORT_SIZE != 0) {
throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().
getString("message.lengthNotMultipleOfShort", new Object[]{Integer.valueOf(SHORT_SIZE)}));
}
return octetLength / SHORT_SIZE;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:ShortEncodingAlgorithm.java
注:本文中的com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论