62,614
社区成员
发帖
与我相关
我的任务
分享
try {
String str_attachmemt = "";
FileInputStream in = new FileInputStream(f);
System.out.println("可读大小:" + in.available());
byte[] b = new byte[in.available()];
int len = in.read(b, 0, b.length);
str_attachmemt += new String(b, 0, len, "iso-8859-1");
System.out.println(str_attachmemt + "\n"
+ str_attachmemt.getBytes("iso-8859-1").length);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}