Code example for LineNumberReader

Methods: mark, readLine, reset, skip

0
 
    /** 
     * @tests java.io.LineNumberReader#mark(int) 
     */ 
    public void test_markI() throws IOException { 
        lnr = new LineNumberReader(new StringReader(text));
        String line;
        lnr.skip(80);
        lnr.mark(100);
        line = lnr.readLine();
        lnr.reset();
        assertTrue("Failed to return to marked position", line.equals(lnr
                .readLine()));
        // The spec does not say the mark has to be invalidated 
    } 
 
    /** 
     * @tests java.io.LineNumberReader#read() 
     */ 
    public void test_read() throws IOException { 
        lnr = new LineNumberReader(new StringReader(text));