因此,我的Java应用程序能够发现一些使用PHP的gzdeflate()生成的数据。 现在我试图用Java来夸大这些数据。这是我到目前为止:Java中的gzinflate
InflaterInputStream inflInstream = new InflaterInputStream(new ByteArrayInputStream(inputData.getBytes()), new Inflater());
byte bytes[] = new byte[1024];
while (true) {
int length = inflInstream.read(bytes, 0, 1024);
if (length == -1) break;
System.out.write(bytes, 0, length);
}
'inputData'是一个包含放缩数据的字符串。
的问题是:尽量不正确头检查
在这个问题上的其他网站只能去重新定向:在.read方法抛出一个异常:
java.util.zip.ZipException我到Inflater类的文档,但显然我不知道如何使用它来与PHP兼容。
谢谢,这样做 – 2012-07-09 21:17:36