Java IO Tutorial - Java BufferedReader .markSupported ()








Syntax

BufferedReader.markSupported() has the following syntax.

public boolean markSupported()

Example

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

/*from  w  w w.ja v a 2 s  .  c om*/
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;

public class Main {
  public static void main(String[] args) throws Exception {

    InputStream is = new FileInputStream("c:/test.txt");

    InputStreamReader isr = new InputStreamReader(is);

    BufferedReader br = new BufferedReader(isr);

    boolean bool = false;

    bool = br.markSupported();

    System.out.println("Buffered reader supports mark : " + bool);

  }
}