markSupported()方法markSupported()方法在java.io包中可用。
的markSupported()方法被用来检查是否此流的载体mark(),reset()或没有。
markSupported()方法是一个非静态方法,只能通过类对象访问,如果尝试使用类名称访问该方法,则会收到错误消息。
在检查支持方法时,markSupported()方法不会引发异常。
语法:
public boolean markSupported();
参数:
它不接受任何参数。
返回值:
该方法的返回类型为布尔值,当此流支持mark()方法时返回true,否则返回false。
示例
//Java程序演示示例 
//方法
//PushbackInputStream-
import java.io.*;
public class MarkSupportedOfPBIS {
    public static void main(String[] args) throws Exception {
        byte[] b_arr = {
            97,
            98,
            99,
            100
        };
        InputStream is_stm = null;
        PushbackInputStream pb_stm = null;
        try {
            //实例化ByteArrayOutputStream和PushbackInputStream-
            is_stm = new ByteArrayInputStream(b_arr);
            pb_stm = new PushbackInputStream(is_stm);
            //通过使用markSupported()方法是
            //检查此流是否支持
            // mark()方法与否
            boolean status = pb_stm.markSupported();
            System.out.println("pb_stm.markSupported(): " + status);
        } catch (Exception ex) {
            System.out.println(ex.toString());
        } finally {
            if (is_stm != null)
                is_stm.close();
            if (pb_stm != null)
                pb_stm.close();
        }
    }
}输出结果
pb_stm.markSupported(): false