Code example for InflaterOutputStream

Methods: write

0
     */ 
    public void test_write_$BII() throws IOException { 
        int length = compressToBytes(testString);
 
        // uncompress the data stored in the compressedBytes 
        InflaterOutputStream ios = new InflaterOutputStream(os);
        ios.write(compressedBytes, 0, length);
 
        String result = new String(os.toByteArray());
        assertEquals(testString, result);
    } 
 
    /** 
     * @tests java.util.zip.InflaterOutputStream#write(byte[],int,int) 
     */ 
    public void test_write_$BII_Illegal() throws IOException { 
        // write error compression (ZIP) format 
        InflaterOutputStream ios = new InflaterOutputStream(os);
        byte[] bytes = { 0, 1, 2, 3 };
        try { 
            ios.write(bytes, 0, 4);