当前位置: 首页>>代码示例>>Java>>正文


Java VTDNav.FORMAT_ASCII属性代码示例

本文整理汇总了Java中com.ximpleware.VTDNav.FORMAT_ASCII属性的典型用法代码示例。如果您正苦于以下问题:Java VTDNav.FORMAT_ASCII属性的具体用法?Java VTDNav.FORMAT_ASCII怎么用?Java VTDNav.FORMAT_ASCII使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.ximpleware.VTDNav的用法示例。


在下文中一共展示了VTDNav.FORMAT_ASCII属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getLen

/**
 * 
 * @param ch
 * @param output_encoding
 * @return
 * @throws TranscodeException
 *  
 */
public static final int getLen(int ch, int output_encoding)
        throws TranscodeException {
    switch (output_encoding) {
    case VTDNav.FORMAT_ASCII:
        return ASCII_Coder.getLen(ch);
    case VTDNav.FORMAT_UTF8:
        return UTF8_Coder.getLen(ch);
    case VTDNav.FORMAT_ISO_8859_1:
        return ISO8859_1Coder.getLen(ch);
    case VTDNav.FORMAT_UTF_16LE:
        return UTF16LE_Coder.getLen(ch);
    case VTDNav.FORMAT_UTF_16BE:
        return UTF16BE_Coder.getLen(ch);
    default:
        throw new com.ximpleware.TranscodeException("Unsupported encoding");
    }
}
 
开发者ID:CoolBalance,项目名称:vtd-xml,代码行数:25,代码来源:Transcoder.java

示例2: decode

/**
 * 
 * @param input
 * @param offset
 * @param input_encoding
 * @return
 * @throws TranscodeException
 *  
 */
public static final long decode(byte[] input, int offset, int input_encoding)
        throws TranscodeException {
    switch (input_encoding) {
    case VTDNav.FORMAT_ASCII:
        return ASCII_Coder.decode(input, offset);
    case VTDNav.FORMAT_UTF8:
        return UTF8_Coder.decode(input, offset);
    case VTDNav.FORMAT_ISO_8859_1:
        return ISO8859_1Coder.decode(input, offset);
    case VTDNav.FORMAT_UTF_16LE:
        return UTF16LE_Coder.decode(input, offset);
    case VTDNav.FORMAT_UTF_16BE:
        return UTF16BE_Coder.decode(input, offset);
    default:
        throw new com.ximpleware.TranscodeException("Unsupported encoding");
    }
}
 
开发者ID:CoolBalance,项目名称:vtd-xml,代码行数:26,代码来源:Transcoder.java

示例3: encode

/**
 * 
 * @param output
 * @param offset
 * @param ch
 * @param output_encoding
 * @return
 * @throws TranscodeException
 *  
 */
public static final int encode(byte[] output, int offset, int ch,
        int output_encoding) throws TranscodeException {
    switch (output_encoding) {
    case VTDNav.FORMAT_ASCII:
        return ASCII_Coder.encode(output, offset, ch);
    case VTDNav.FORMAT_UTF8:
        return UTF8_Coder.encode(output, offset, ch);
    case VTDNav.FORMAT_ISO_8859_1:
        return ISO8859_1Coder.encode(output, offset, ch);
    case VTDNav.FORMAT_UTF_16LE:
        return UTF16LE_Coder.encode(output, offset, ch);
    case VTDNav.FORMAT_UTF_16BE:
        return UTF16BE_Coder.encode(output, offset, ch);
    default:
        throw new com.ximpleware.TranscodeException("Unsupported encoding");
    }
}
 
开发者ID:CoolBalance,项目名称:vtd-xml,代码行数:27,代码来源:Transcoder.java

示例4: encodeAndWrite

public static final void encodeAndWrite(OutputStream os, int ch,
        int output_encoding) throws TranscodeException, IOException {
    switch (output_encoding) {
    case VTDNav.FORMAT_ASCII:
         ASCII_Coder.encodeAndWrite(os, ch);
    	 return;
    case VTDNav.FORMAT_UTF8:
         UTF8_Coder.encodeAndWrite(os,  ch);
    	 return;
    case VTDNav.FORMAT_ISO_8859_1:
         ISO8859_1Coder.encodeAndWrite(os, ch);
    	 return;
    case VTDNav.FORMAT_UTF_16LE:
         UTF16LE_Coder.encodeAndWrite(os, ch);
    	 return;
    case VTDNav.FORMAT_UTF_16BE:
         UTF16BE_Coder.encodeAndWrite(os, ch);
    	 return;
    default:
        throw new com.ximpleware.TranscodeException("Unsupported encoding");
    }
}
 
开发者ID:CoolBalance,项目名称:vtd-xml,代码行数:22,代码来源:Transcoder.java

示例5: getCharsetByEncoding

/**
 * 根据 vn 的 encoding 获取字符集编码(此方法与 XMLModifier 的 bind 方法中获取字符集的方式一致)
 * @return
 * @throws ModifyException
 *             ;
 */
public String getCharsetByEncoding() throws ModifyException {
	int encoding = vn.getEncoding();
	switch (encoding) {
	case VTDNav.FORMAT_ASCII:
		return "ASCII";
	case VTDNav.FORMAT_ISO_8859_1:
		return "ISO8859_1";
	case VTDNav.FORMAT_UTF8:
		return "UTF8";
	case VTDNav.FORMAT_UTF_16BE:
		return "UnicodeBigUnmarked";
	case VTDNav.FORMAT_UTF_16LE:
		return "UnicodeLittleUnmarked";
	case VTDNav.FORMAT_ISO_8859_2:
		return "ISO8859_2";
	case VTDNav.FORMAT_ISO_8859_3:
		return "ISO8859_3";
	case VTDNav.FORMAT_ISO_8859_4:
		return "ISO8859_4";
	case VTDNav.FORMAT_ISO_8859_5:
		return "ISO8859_5";
	case VTDNav.FORMAT_ISO_8859_6:
		return "ISO8859_6";
	case VTDNav.FORMAT_ISO_8859_7:
		return "ISO8859_7";
	case VTDNav.FORMAT_ISO_8859_8:
		return "ISO8859_8";
	case VTDNav.FORMAT_ISO_8859_9:
		return "ISO8859_9";
	case VTDNav.FORMAT_ISO_8859_10:
		return "ISO8859_10";
	case VTDNav.FORMAT_ISO_8859_11:
		return "x-iso-8859-11";
	case VTDNav.FORMAT_ISO_8859_12:
		return "ISO8859_12";
	case VTDNav.FORMAT_ISO_8859_13:
		return "ISO8859_13";
	case VTDNav.FORMAT_ISO_8859_14:
		return "ISO8859_14";
	case VTDNav.FORMAT_ISO_8859_15:
		return "ISO8859_15";

	case VTDNav.FORMAT_WIN_1250:
		return "Cp1250";
	case VTDNav.FORMAT_WIN_1251:
		return "Cp1251";
	case VTDNav.FORMAT_WIN_1252:
		return "Cp1252";
	case VTDNav.FORMAT_WIN_1253:
		return "Cp1253";
	case VTDNav.FORMAT_WIN_1254:
		return "Cp1254";
	case VTDNav.FORMAT_WIN_1255:
		return "Cp1255";
	case VTDNav.FORMAT_WIN_1256:
		return "Cp1256";
	case VTDNav.FORMAT_WIN_1257:
		return "Cp1257";
	case VTDNav.FORMAT_WIN_1258:
		return "Cp1258";
	default:
		throw new ModifyException(Messages.getString("vtdimpl.VTDUtils.logger2"));
	}
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:70,代码来源:VTDUtils.java


注:本文中的com.ximpleware.VTDNav.FORMAT_ASCII属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。