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.
// w ww . jav a2s . 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);
}
}
Home »
Java Tutorial »
java.io »
Java Tutorial »
java.io »