Code example for StringBufferInputStream

Methods: read

0
 
    public void test_read$BII_Exception() { 
        // Test for method int java.io.StringBufferInputStream.read() 
        byte[] buf = new byte[10];
        try { 
            sbis.read(buf, 0, -1);
            fail("IndexOutOfBoundsException was not thrown");
        } catch (IndexOutOfBoundsException e) {
            // Expected 
        } 
        try { 
            sbis.read(buf, -1, 1);
            fail("IndexOutOfBoundsException was not thrown");
        } catch (IndexOutOfBoundsException e) {
            // Expected 
        } 
        try { 
            sbis.read(buf, 10, 1);
            fail("IndexOutOfBoundsException was not thrown");
        } catch (IndexOutOfBoundsException e) {
            // Expected 
        } 
    }