java读取txt文件中的内容,在线等
calsslist.txt文件中,有些内容,
现如何在java代码中用system.out.println 输出来,
在线等 thanks
[解决办法]
/** * @param args */ public static void main(String[] args) { try { InputStream is = new FileInputStream("F:/测试.txt"); byte[] buffer = new byte[1024 * 10]; while (is.read(buffer) != -1) { System.out.println(new String(buffer,"utf-8")); } } catch (Exception e) { e.printStackTrace(); } }
[解决办法]