Code example for Deflater

Methods: getBytesRead, getBytesWritten, getTotalIn, getTotalOut

0
        args = {int.class} 
    ) 
    public void test_ConstructorI() throws Exception { 
        byte[] byteArray = new byte[100];
        InputStream inFile = Support_Resources.getStream("hyts_checkInput.txt");
        inFile.read(byteArray);
        inFile.close();
 
        byte outPutBuf[] = new byte[500];
        Deflater defl = new Deflater(3);
        defl.setInput(byteArray);
        while (!defl.needsInput()) {
            defl.deflate(outPutBuf);
        } 
        defl.finish();
        while (!defl.finished()) {
            defl.deflate(outPutBuf);
        } 
        int totalOut = defl.getTotalOut();
        defl.end();