我正在尝试读取经过ascii编码的文件,但是我没有得到正确的输出...
private static final String PATH_ARQUIVO_ASCII = "myfileASCII.txt";
public static void main(String[] args) {
try (BufferedReader br = new BufferedReader(new FileReader(PATH_ARQUIVO_ASCII))) {
String line;
while ((line = br.readLine()) != null) {
System.out.println(line);
}
} catch (IOException e) {
e.printStackTrace();
}
}
该文件包含0到1000的数字和已编码的ascii。我正在使用Java,是否有更好的解决方案?