java - 解析来自 REST 的压缩 InputStream
问题描述
在我的 Java 后端,我收到一个已压缩的 json 文件。
到目前为止我所拥有的是:
myMethod(InputStream inputStream) {
ZipInputStream zip = new ZipInputStream(inputStream);
JsonFactory jfactory = new JsonFactory();
JsonParser jsonParser = jfactory.createParser(zip);
jsonParser.nextToken();//i am expecting this to be "{" but this always returns null
}
我错过了什么?
解决方案
推荐阅读
- powershell - Powershell:Import-CSV - 如何选择特定单元格(即:A5、A10.A15)
- python - 比较数据框值错误中的 2 列
- c - 为什么在文件或结构中使用多个互斥锁?
- c# - C# - 如何为程序创建“保护进程”并确保它始终运行?
- php - WordPress:获取带有状态草稿并已发布的用户帖子数量
- android-studio - 带有复选框的android中的Snackbar小部件使用
- tensorflow - Keras 模型无法预测预期输出
- hive - Hive 日期功能:获取月份部分
- flutter - 有状态小部件的访问方法
- java - Okhttp GET 请求是否默认使用 gzip?