我想使用Gzip压缩在java中压缩输入流.
假设我们有一个未压缩的输入流(1GB数据..).我希望结果来自源的压缩输入流:
public InputStream getCompressedStream(InputStream unCompressedStream) {
// Not working because it's uncompressing the stream, I want the opposite.
return new GZIPInputStream(unCompressedStream);
}
Run Code Online (Sandbox Code Playgroud)