Java IO Tutorial - Java FilterReader.markSupported()








Syntax

FilterReader.markSupported() has the following syntax.

public boolean markSupported()

Example

In the following code shows how to use FilterReader.markSupported() method.

import java.io.FilterReader;
import java.io.Reader;
import java.io.StringReader;
//  w  ww.ja v  a2  s  .  co 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);

  }
}

The code above generates the following result.