/* -*-mode:java; c-basic-offset:2; -*- */ import java.io.*; import com.jcraft.jzlib.*; // Test deflate() with small buffers class test_deflate_inflate{ static final byte[] hello="hello, hello! ".getBytes(); static{ hello[hello.length-1]=0; } public static void main(String[] arg){ int err; int comprLen=40000; int uncomprLen=comprLen; byte[] compr=new byte[comprLen]; byte[] uncompr=new byte[uncomprLen]; Deflater deflater = null; try { deflater = new Deflater(JZlib.Z_DEFAULT_COMPRESSION); } catch(GZIPException e){ // never happen, because argument is valid. } deflater.setInput(hello); deflater.setOutput(compr); while(deflater.total_in!=hello.length && deflater.total_out