Spring-Core5.2具有带有诸如StringDecoder解码器的编解码器包,该解码器支持反应式编程。获取Publisher<DataBuffer>并返回解码后的Flux<String>。
我希望找到gzip的Publisher<DataBuffer>或Publisher<ByteArray>的GzipDecoder,并返回未压缩的Flux<ByteArray>,但我没有找到它。
我发现唯一符合我需求库是https://github.com/kptfh/gzip-reactive,但它非常不成熟
熟悉成熟的代码吗?
发布于 2020-03-31 20:25:33
我发现上面的项目复制了org.eclipse.jetty.http.GZIPContentDecoder中的代码
我在下面添加了依赖项(由spring boot管理)
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-http</artifactId>
</dependency>并使用map函数示例中的decode方法:
GZIPContentDecoder decoder = new GZIPContentDecoder(2048);
return Flux.from(input).map(decoder::decode)
.doFinally(signalType -> decoder.destroy());https://stackoverflow.com/questions/59822237
复制相似问题