• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Garbage when Compressing a Byte array

Andres Gorzelany
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all guys

I am sure you can help me with this, I am using jazzlib (http://jazzlib.sourceforge.net/) ZIP library for deflating and inflating data, I was all day trying to find examples and I came with this:

that works very fine (I decryted the data and it's the same as the original) except that the compressed byte[] is longer than the uncompressed.

As you see this is unacceptable, and I think that these lines are the cause:

I am creating a buffer of length=input.length and that's obviusly bigger than compressed data, How can I resolve this if I can't dinamically allocate buf array and bos object?

Thanks guys!

JDK 6 - Latest Version of Jazzlib
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic