Code example for Inflater

Methods: inflateneedsInputsetInput

        byte[] b = new byte[1024];
        assertEquals(0, inflater.inflate(b));
        // Regression for HARMONY-2510 
        inflater = new Inflater();
        inflater.setInput(new byte[] { -1 });
        try { 
            // The RI detects malformed data on the malformed input { -1 }. Both 
            // this implementation and the native zlib API return "need input" 
            // on that data. This is an error if the stream is exhausted, but 
            // not one that results in an exception in the Inflater API. 
        } catch (DataFormatException e) {
            // expected 
        inflater = new Inflater();
Stop searching for code, let great code find you!  Add Codota to your java IDE