字节流 system.in

public class StreamDemo5 {
public static void main(String[] args) {
try {
byte[] b = new byte[10000];
System.out.println("请输入:");
while(true){
int bytes = System.in.read(b,0,b.length);
String s = new String(b,0,bytes);
if("end".equals(s))break;
System.out.println(s);
}
} catch (Exception e) {
e.printStackTrace();
}
}

}

posted @ 2016-01-24 14:29  烧山火的光  阅读(185)  评论(0编辑  收藏  举报