Code example for LineNumberInputStream

Methods: closegetLineNumberskip

0
        assertEquals("Test 2: Failed to set line number;",
                89, lnis.getLineNumber());
    } 
 
    public void test_skipJ() throws IOException { 
        long skipped = lnis.skip(4);
        assertEquals("Test 1: Incorrect number of characters skipped;",
                4, skipped);
        assertEquals("Test 2: Skip failed to increment line number;",
                2, lnis.getLineNumber());
 
        lnis.close();
        try { 
            lnis.skip(4);
            fail("Test 3: IOException expected.");
        } catch (IOException e) {
            // Expected. 
        } 
    } 
 
Contextual code suggestions in your IDE  Get Codota for Java