Code example for LineNumberInputStream

Methods: read

0
    /** 
     * @tests java.io.LineNumberInputStream#read(byte[], int, int) 
     */ 
    public void test_read$BII() throws IOException, UnsupportedEncodingException { 
        byte[] buf = new byte[100];
        lnis.read(buf, 0, 100);
        assertTrue("Failed to read correct bytes on normal text", new String(
                buf, 0, 100, "UTF-8").equals(text.substring(0, 100)));
    } 
 
    /** 
     * @tests java.io.LineNumberInputStream#reset() 
     */ 
    public void test_reset() throws IOException { 
        lnis.mark(40);
        lnis.skip(4);
        lnis.reset();
        assertEquals("Failed to reset", 0, lnis.getLineNumber());
        assertEquals("Failed to reset", '0', lnis.read());
        lnis.reset();