本文介绍了获取此GZIPInputStream的未压缩大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 GZIPInputStream ,我是从另一个 ByteArrayInputStream 构建的。我想知道gzip数据的原始(未压缩)长度。虽然我可以读到 GZIPInputStream 的结尾,然后计算数字,它会花费很多时间并浪费CPU。我想在读之前知道它的大小。

I have a GZIPInputStream that I constructed from another ByteArrayInputStream. I want to know the original (uncompressed) length for the gzip data. Although I can read to the end of the GZIPInputStream, then count the number, it will cost much time and waste CPU. I would like to know the size before read it.

是否有类似的方法,如 ZipEntry.getSize() for GZIPInputStream

Is there a similiar method like ZipEntry.getSize() for GZIPInputStream:


推荐答案

不。它不在 =>它不存在。

No. It's not in the Javadoc => it doesn't exist.

你需要什么长度

这篇关于获取此GZIPInputStream的未压缩大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 13:39