Code example for LineNumberInputStream

Methods: closeavailable

0
 
    LineNumberInputStream lnis2;
 
    public void test_available() throws IOException { 
        assertEquals("Test 1: Returned incorrect number of available bytes;",
                text.length() / 2, lnis.available());
 
        lnis.close();
        try { 
            lnis.available();
            fail("Test 2: IOException expected.");
        } catch (IOException e) {
            // Expected. 
        } 
    } 
 
    public void test_read() throws IOException { 
        assertEquals("Test 1: Failed to read correct byte;",
                '0', lnis.read());
        assertEquals("Test 2: Failed to read correct byte on dos text;",
Stop searching for code, let great code find you!  Add Codota to your java IDE