【发布时间】:2015-02-15 22:15:09
【问题描述】:
对于我的 android 应用程序,它将以已压缩的 JSON 格式从服务器检索数据。
我用:
InputStream stream = new GZIPInputStream(entity.getContent());
要读取流,这应该在我读取数据时解压缩数据。
问题是无论我在服务器端使用什么 Gz 算法(PHP)我都会在我的 android 应用程序中得到“未知格式(幻数 ____)”。
gzencode($json); //gives 1F20
gzcompress($json); //gives 7820
我尝试了几种不同的解压缩数据的方法,但它们给出了相同的错误。
想法?
【问题讨论】: