阅读开源库源码,发现这两个方法,惭愧啊!真没看明白
public static int TypeToInt(String type) { int result = (type[0] << 24) + (type[1] << 16) + (type[2] << 8) + type[3]; return result; } public static String IntToType(int type) { StringBuilder sb = new StringBuilder(); sb.Append((char)((type >> 24) & 0xff)); sb.Append((char)((type >> 16) & 0xff)); sb.Append((char)((type >> 8) & 0xff)); sb.Append((char)(type & 0xff)); return sb.ToString(); }