Code example for DeflaterInputStream

Methods: availablecloseread

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