日期:2014-05-19 浏览次数:20695 次
InputStream in = new FileInputStream(file); BufferedReader br = new BufferedReader(new InputStreamReader(in, "UTF-8")); long count = 0; String line = br.readLine(); while (line != null) { count += line.getBytes("UTF-8").length; count += 1; // Add \r's length System.out.println(Thread.currentThread() + " " + line); System.out.println(" count:" + count); line = br.readLine(); }
InputStream in = new FileInputStream(file); System.out.println(in.available());