标签:字符流 缓存 bufferedreader
//接收数据 BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream())); String msg = in.readLine(); if (null != msg){ System.out.println(msg); }
FileReader fr = new FileReader("D:\\Test.txt"); BufferedReader bf = new BufferedReader(fr); int temp; while ((temp = bf.read()) != -1){ System.out.println(bf.readLine()); }
String msg = null; while ((msg=bf.readLine())!=null){ System.out.println(msg); }
标签:字符流 缓存 bufferedreader
原文地址:http://blog.csdn.net/pengkv/article/details/41575353