Java IO Tutorial - Java BufferedInputStream .markSupported ()








Syntax

BufferedInputStream.markSupported() has the following syntax.

public boolean markSupported()

Example

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

/*from w  w  w.  ja  v  a 2s. c o m*/

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.InputStream;

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

    boolean bool = false;

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

    // input stream is converted to buffered input stream
    BufferedInputStream bis = new BufferedInputStream(inStream);

    // returns true if mark() and read() supports
    bool = bis.markSupported();
    System.out.println("Support for mark() and reset() : " + bool);

  }
}