/*按字节读取字符串*//* 个人感觉最好的方式,(一次读完)读字节就读字节吧,读完转码一次不就好了*/private static String readString3(){ String str=""; File file=new File(FILE_IN); try { FileInputStream in=new FileInputStream(file); // size 为字串的长度 ,这里一次性读完 int size=in.available(); byte[] buffer=new byte[size]; in.read(buffer); in.close(); str=new String(buffer,"GB2312"); } catch (IOException e) { // TODO Auto-generated catch block return null; e.printStackTrace(); } return str;}
195

被折叠的 条评论
为什么被折叠?



