import java.io.*;
class B extends FilterInputStream{
B(InputStream in){
super(in);
}
public static void main(String[] args)throws IOException{
byte[] b=new byte[10];
B in=new B(System.in);
long x=in.read(b);
System.out.println(in.markSupported());
in.mark(50);
System.out.println(in.markSupported());
for(int i=0;i<10;i++)
System.out.print(b[i]+" ");
System.out.println();
System.out.println(x+" "+b[0]+" "+" "+b[1]+" "+in.available());
in.reset();
x=in.read(b);
System.out.println(x+" "+b[0]+" "+" "+b[1]+" "+in.available());
for(int i=0;i<10;i++)
System.out.print(b[i]+" ");
System.out.println(x+" "+b[0]+" "+" "+b[1]+" "+in.available());
}
}
我连按两个回车,第一次这个数组最后一个数是0,但是为什么第二次最后这个数却变成了2,想知道原因,请教了!!