Code example for SequenceInputStream

Methods: available

0
    SequenceInputStream si;
    String s1 = "Hello";
    String s2 = "World";
 
    public void test_available() throws IOException { 
        assertEquals("Returned incorrect number of bytes!", s1.length(), si.available());
        simple2.throwExceptionOnNextUse = true;
        assertTrue("IOException on second stream should not affect at this time!",
                si.available() == s1.length());
        simple1.throwExceptionOnNextUse = true;
        try { 
            si.available();
            fail("IOException not thrown!");
        } catch (IOException e) {
            // expected 
        } 
    } 
 
    public void test_close2() throws IOException { 
        simple1.throwExceptionOnNextUse = true;
Connect your IDE to all the code out there  Get Codota for Java