上述文件扩展名的解释见 http://kb.iu.edu/data/abck.html 。我想使用 java api 读取 Z 文件的内容。 ZipFile api 或 GZIPInputStream 似乎都不起作用。我可以使用 ZipFile api 打开普通的 .zip 文件。
ZipFile zf = new ZipFile("CR93H2.Z");
Enumeration entries = zf.entries();
补充一下,上述 .Z 文件在 winrar 中可以正常打开。
有谁知道解决办法吗?
谢谢
最佳答案
您可以使用 compress-j2me:
% git clone https://github.com/igorgatis/compress-j2me.git
% cd compress-j2me/src/lzc-test
% ant -q
% cd build/cmd
% echo "testdonkeyballs" | compress | java com.googlecode.compress_j2me.lzc.Main -d
testdonkeyballs
要获得可维护的替代方案,请尝试 Apache Commons-Compress .
关于java - 在Java中读取.Z文件(unix压缩文件),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3473179/