Code example for LineNumberInputStream

Methods: read

0
 
    public void test_read$BII_Exception() throws IOException { 
        byte[] buf = new byte[10];
 
        try { 
            lnis.read(buf, -1, 1);
            fail("IndexOutOfBoundsException expected.");
        } catch (IndexOutOfBoundsException e) {
            // Expected. 
        } 
 
        try { 
            lnis.read(buf, 0, -1);
            fail("IndexOutOfBoundsException expected.");
        } catch (IndexOutOfBoundsException e) {
            // Expected. 
        } 
 
        try { 
            lnis.read(buf, 10, 1);
            fail("IndexOutOfBoundsException expected.");
        } catch (IndexOutOfBoundsException e) {
            // Expected. 
        } 
    }