File file = new File("F:/hejing/InstrumentJsonData.txt");
StringBuilder localStrBulider = new StringBuilder();
if(file.isFile() && file.exists()) {
try {
InputStreamReader inputStreamReader = new InputStreamReader(new FileInputStream(file), "utf-8");
BufferedReader bufferReader = new BufferedReader(inputStreamReader);
String lineStr = null;
try {
while((lineStr = bufferReader.readLine()) != null) {
localStrBulider.append(lineStr);
}
bufferReader.close();
inputStreamReader.close();
} catch (IOException e) {
// TODO Auto-generated catch block
System.out.println("file read error!");
e.printStackTrace();
}
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
System.out.println("file catch unsupported encoding!");
e.printStackTrace();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
System.out.println("file not found!");
e.printStackTrace();
}
}else {
System.out.println("file is not a file or file is not existing!");
return null;
}
System.out.println("localStrBulider.toString():" + localStrBulider.toString());
路漫漫其修远兮,吾将上下而求索!