I tried using the jazzlib library to create a zip file but i only get PK when i finished. I tried different string but i got the same result. Here is my code: import net.sf.jazzlib.*;
import java.io.*;

public class e {

public static byte[] compress(String data) throws IOException {
byte[] value = data.getBytes();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ZipOutputStream zos = new ZipOutputStream(bos);
ZipEntry ze = new ZipEntry("msg.gz");
long length = value.length;
ze.setSize(length);
zos.putNextEntry(ze);
zos.setMethod(ZipOutputStream.DEFLATED);

zos.write(value, 0, value.length);

zos.closeEntry();
zos.close();
byte[] values = bos.toByteArray();
bos.close();
return values;
}
}
. I call the code with try { e.compress("messages"); } catch(Exception e) { } . Please help me.