List of usage examples for java.io LineNumberInputStream markSupported
public boolean markSupported()
mark
and reset
methods. From source file:Main.java
public static void main(String[] args) throws IOException { FileInputStream fis = new FileInputStream("C:/test.txt"); LineNumberInputStream lnis = new LineNumberInputStream(fis); System.out.println((char) lnis.read()); System.out.println((char) lnis.read()); lnis.mark(0);/*from w w w . ja v a2 s .c o m*/ System.out.println("mark() invoked"); System.out.println((char) lnis.read()); System.out.println((char) lnis.read()); if (lnis.markSupported()) { lnis.reset(); System.out.println("reset() invoked"); System.out.println((char) lnis.read()); System.out.println((char) lnis.read()); } }
From source file:Main.java
public static void main(String[] args) throws IOException { FileInputStream fis = new FileInputStream("C:/test.txt"); LineNumberInputStream lnis = new LineNumberInputStream(fis); System.out.println((char) lnis.read()); System.out.println((char) lnis.read()); lnis.mark(0);/*from www . jav a2s .c o m*/ System.out.println("mark() invoked"); System.out.println((char) lnis.read()); System.out.println((char) lnis.read()); if (lnis.markSupported()) { lnis.reset(); System.out.println("reset() invoked"); System.out.println((char) lnis.read()); System.out.println((char) lnis.read()); } }