FilterReader.markSupported()方法示例
FilterReader.markSupported()
具有以下语法。
public boolean markSupported()
示例
在下面的代码中展示了如何使用FilterReader.markSupported()
方法。
import java.io.FilterReader;
import java.io.Reader;
import java.io.StringReader;
// by w w W.YIIB AI.c O M
public class Main {
public static void main(String[] args) throws Exception {
// create new reader
Reader r = new StringReader("ABCDEF");
// create new filter reader
FilterReader fr = new FilterReader(r) {
};
// tests if the filter reader supports mark()
boolean bool = fr.markSupported();
// prints
System.out.print("If mark() supported? " + bool);
}
}
上面的代码生成以下结果。
If mark() supported? true