Code example for LineNumberInputStream

Methods: getLineNumbermarkreadresetskip

0
 
    /** 
     * @tests java.io.LineNumberInputStream#mark(int) 
     */ 
    public void test_markI() throws IOException { 
        lnis.mark(40);
        lnis.skip(4);
        lnis.reset();
        assertEquals("Failed to mark", 0, lnis.getLineNumber());
        assertEquals("Failed to mark", '0', lnis.read());
    } 
 
    /** 
     * @tests java.io.LineNumberInputStream#read() 
     */ 
    public void test_read() throws IOException { 
        assertEquals("Failed to read correct byte", '0', lnis.read());
        assertEquals("Failed to read correct byte on dos text", '0', lnis2
                .read());
        assertTrue("Failed to read correct byte on dos text",
                lnis2.read() == '\n');