Error when uncompressing file in unix

I have created a zip file Sample.Z by using ZIPOutputStream API in java. when i uncompress the zip file which i created in UNIX, I m getting a error message not in compressed format. But i am able to uncompress it in both WINDOWS and LINUX. Can anyone help me. Its urgent plz.....................

Thanks in advance

[327 byte] By [Rosy_Thomas@Javaa] at [2007-11-27 6:50:10]
# 1
The extension .Z in Unix normally means that it has been compressed with 'compress' which does not use the same algorithm as zip. Try uncompressing with gzip/gunzip.
sabre150a at 2007-7-12 18:24:03 > top of Java-index,Java Essentials,Java Programming...
# 2

Hi ,

Thanks a lot for ur immediate response.

I can able to gunzip that file. Because ZIPOutputStream will create a gz file.

But i want to create a file with the extension .Z that means with the Unix compress format. I want to use "uncompress" command only in unix.

Do you have any idea like how to create a UNIX compress format file in java. Is there any API for that.

thanks.

Rosy_Thomas@Javaa at 2007-7-12 18:24:03 > top of Java-index,Java Essentials,Java Programming...
# 3
Check out the references in the last response (#17) of http://forum.java.sun.com/thread.jspa?threadID=683914&messageID=3984624 .
sabre150a at 2007-7-12 18:24:03 > top of Java-index,Java Essentials,Java Programming...