BufferedInputStream.mark(int readlimit)
我阅读了Java文档,但我不知道何时使用此参数“ readlimit
”
在这段代码中,我不明白mark(1)或mark(100)的区别
public static void main(String[] args) throws Exception {
String s="123456789ABCDEFGHIJKLMNOPQRSDVWXYZ";
byte byteArray[]=s.getBytes();
ByteArrayInputStream BArrayIS=new ByteArrayInputStream(byteArray);
BufferedInputStream BIS=new BufferedInputStream(BArrayIS);
BIS.mark(1);
System.out.println(BIS.read());
}