java.nio.charset.CharacterCodingException#toString ( )源码实例Demo

下面列出了java.nio.charset.CharacterCodingException#toString ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: pxf   文件: Text.java
/**
 * Sets to contain the contents of a string.
 *
 * @param string input string
 */
public void set(String string) {
    try {
        ByteBuffer bb = encode(string, true);
        bytes = bb.array();
        length = bb.limit();
    } catch (CharacterCodingException e) {
        throw new RuntimeException("Should not have happened "
                + e.toString());
    }
}
 
源代码2 项目: pxf   文件: Text.java
/**
 * Convert text back to string
 *
 * @see java.lang.Object#toString()
 */
@Override
public String toString() {
    try {
        return decode(bytes, 0, length);
    } catch (CharacterCodingException e) {
        throw new RuntimeException("Should not have happened "
                + e.toString());
    }
}
 
源代码3 项目: Canova   文件: Text.java
/** Set to contain the contents of a string.
 */
public void set(String string) {
    try {
        ByteBuffer bb = encode(string, true);
        bytes = bb.array();
        length = bb.limit();
    }catch(CharacterCodingException e) {
        throw new RuntimeException("Should not have happened " + e.toString());
    }
}
 
源代码4 项目: Canova   文件: Text.java
/**
 * Convert text back to string
 * @see java.lang.Object#toString()
 */
public String toString() {
    try {
        return decode(bytes, 0, length);
    } catch (CharacterCodingException e) {
        throw new RuntimeException("Should not have happened " + e.toString());
    }
}
 
源代码5 项目: RDFS   文件: Text.java
/** Set to contain the contents of a string. 
 */
public void set(String string) {
  try {
    ByteBuffer bb = encode(string, true);
    bytes = bb.array();
    length = bb.limit();
  }catch(CharacterCodingException e) {
    throw new RuntimeException("Should not have happened " + e.toString()); 
  }
}
 
源代码6 项目: RDFS   文件: Text.java
/** 
 * Convert text back to string
 * @see java.lang.Object#toString()
 */
public String toString() {
  try {
    return decode(bytes, 0, length);
  } catch (CharacterCodingException e) { 
    throw new RuntimeException("Should not have happened " + e.toString()); 
  }
}
 
源代码7 项目: stratosphere   文件: StringRecord.java
/**
 * Set to contain the contents of a string.
 */
public void set(final String string) {
	try {
		final ByteBuffer bb = encode(string, true);
		this.bytes = bb.array();
		this.length = bb.limit();
		this.hash = 0;
	} catch (CharacterCodingException e) {
		throw new RuntimeException("Should not have happened " + e.toString());
	}
}
 
源代码8 项目: stratosphere   文件: StringRecord.java
/**
 * Convert text back to string
 * 
 * @see java.lang.Object#toString()
 */
public String toString() {
	try {
		return decode(bytes, 0, length);
	} catch (CharacterCodingException e) {
		throw new RuntimeException("Should not have happened " + e.toString());
	}
}
 
源代码9 项目: hadoop-gpu   文件: Text.java
/** Set to contain the contents of a string. 
 */
public void set(String string) {
  try {
    ByteBuffer bb = encode(string, true);
    bytes = bb.array();
    length = bb.limit();
  }catch(CharacterCodingException e) {
    throw new RuntimeException("Should not have happened " + e.toString()); 
  }
}
 
源代码10 项目: hadoop-gpu   文件: Text.java
/** 
 * Convert text back to string
 * @see java.lang.Object#toString()
 */
public String toString() {
  try {
    return decode(bytes, 0, length);
  } catch (CharacterCodingException e) { 
    throw new RuntimeException("Should not have happened " + e.toString()); 
  }
}
 
源代码11 项目: ArscEditor   文件: MainActivity.java
@Override
protected String doInBackground(String... params) {
	switch (ResType) {

	case ARSC:
		for (ContentValues resource : RESOURCES) {
			// 获取资源的键
			String NAME = (String) resource.get(MyObj.NAME);
			// 获取资源的值
			String VALUE = (String) resource.get(MyObj.VALUE);
			// 获取资源类型
			String TYPE = (String) resource.get(MyObj.TYPE);
			// 获取资源分支
			String CONFIG = (String) resource.get(MyObj.CONFIG);

			// 如果资源的Config开头存在-符号,并且Config列表中不存在该资源的Config元素,并且资源种类是params[0]的值
			if (CONFIG.startsWith("-") && !Configs.contains(CONFIG.substring(1)) && TYPE.equals(params[0]))
				// 向Config列表中添加元素
				Configs.add(CONFIG.substring(1));
			// 如果资源的Config开头不存在-符号,并且Config列表中不存在该资源的Config元素,并且资源种类是params[0]的值
			else if (!CONFIG.startsWith("-") && !Configs.contains(CONFIG) && TYPE.equals(params[0]))
				Configs.add(CONFIG);

			// 如果资源的Config开头存在-符号,并且Config列表中存在该资源的Config元素,并且Config是params[1]的值
			if (TYPE.equals(params[0]) && CONFIG.startsWith("-") && CONFIG.substring(1).equals(params[1])) {
				// 向储存字符串的列表中添加字符串成员
				txtOriginal.add(VALUE);
				// 向储存修改后的字符串的列表中添加空成员
				txtTranslated.add("");
				// 向储存资源的键的列表添加键
				txtTranslated_Key.add(NAME);
				// 如果资源的Config开头不存在-符号,并且Config列表中存在该资源的Config元素,并且Config是params[1]的值
			} else if (TYPE.equals(params[0]) && !CONFIG.startsWith("-") && CONFIG.equals(params[1])) {
				// 向储存字符串的列表中添加字符串成员
				txtOriginal.add(VALUE);
				// 向储存修改后的字符串的列表中添加空成员
				txtTranslated.add("");
				// 向储存资源的键的列表添加键
				txtTranslated_Key.add(NAME);
			}
		}
		break;
	case AXML:
		try {
			mAndRes.mAXMLDecoder.getStrings(txtOriginal);
			for (int i = 0; i < txtOriginal.size(); i++) {
				// 向储存修改后的字符串的列表中添加空成员
				txtTranslated.add("");
				// 向储存资源的键添加空成员
				txtTranslated_Key.add("");
			}
		} catch (CharacterCodingException e) {
			return e.toString();
		}
		break;
	case DEX:

		break;
	}
	// 返回一个成功的标志
	return getString(R.string.success);
}