Code example for DeflaterInputStream

Methods: availablecloseread

0
    /** 
     * @tests DeflaterInputStream#available() 
     */ 
    public void testAvailable() throws IOException { 
        byte[] buf = new byte[1024];
        DeflaterInputStream dis = new DeflaterInputStream(is);
        assertEquals(1, dis.available());
        assertEquals(120, dis.read());
        assertEquals(1, dis.available());
        assertEquals(22, dis.read(buf, 0, 1024));
        assertEquals(1, dis.available());
        assertEquals(-1, dis.read());
        assertEquals(0, dis.available());
        dis.close();
        try { 
            dis.available();
            fail("should throw IOException");
        } catch (IOException e) {
            // expected 
        } 
    } 
Connect your IDE to all the code out there  Get Codota for Java