/** *判断字符类型 */ function CharMode(iN) { if (iN >= 48 && iN <= 57) //数字 return 1; if (iN >= 65 && iN <= 90) //大写字母 return 2; if (iN >= 97 && iN <= 122) //小写 return 4; else return 8; //特殊字符 } /** * 统计字符类型 */ function
+ (NSString *)typeForImageData:(NSData *)data { uint8_t c; [data getBytes:&c length:1]; switch (c) { case 0xFF: return @"image/jpeg"; case 0x89: return @"image/png"; case 0x47: return @"image/gif"; case 0x49: case 0x4D: r
public static final String TYPE_JPG = "jpg"; public static final String TYPE_GIF = "gif"; public static final String TYPE_PNG = "png"; public static final String TYPE_BMP = "bmp"; public static final String TYPE_UNK