Java decompressing array of bytes

前端 未结 2 566
悲&欢浪女
悲&欢浪女 2021-01-22 12:10

On server (C++), binary data is compressed using ZLib function:

compress2()

and it\'s sent over to client (Java). On client side (

2条回答
  •  礼貌的吻别
    2021-01-22 12:44

    InflaterInputStream is expecting raw deflate data (RFC 1951), whereas compress2() is producing zlib-wrapped deflate data (RFC 1950 around RFC 1951).

    Inflater on the other hand does process zlib-wrapped data (unless you give it the nowrap option). Go figure.

提交回复
热议问题