File jsonFile = new File("E:\\temp\\002481821.json");
//以下读取不会乱码
Reader reader = new InputStreamReader(new FileInputStream(jsonFile),"utf-8");
int ch = 0;
StringBuffer json = new StringBuffer();
while ((ch = reader.read()) != -1) {
json.append((char) ch);
}
reader.close();
//以下读取会乱码
/*
FileInputStream stream = new FileInputStream(jsonFile);
StringBuilder json = new StringBuilder();
int length = 0;
byte[] bytes = new byte[1024];
while ((length = stream.read(bytes)) != -1) {
json.append(new String(bytes, 0, length,"UTF-8"));
}
stream.close();*/