My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 8: Java sample uses Inflater.finished() which doesn't work as expected
6 people starred this issue and may be notified of changes. Back to list
Status:  Accepted
Owner:  ----


 
Project Member Reported by acc%goog...@gtempaccount.com, Dec 21, 2007
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?


Please use labels and text to provide additional information.

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4795299

Workaround: use Inflater.getRemaining() instead.
Dec 21, 2007
Project Member #1 acc%goog...@gtempaccount.com
(No comment was entered for this change.)
Owner: ---
Dec 21, 2007
Project Member #2 acc%goog...@gtempaccount.com
(No comment was entered for this change.)
Status: New
Jun 20, 2008
Project Member #3 acc%goog...@gtempaccount.com
(No comment was entered for this change.)
Status: Accepted
Aug 28, 2008
#4 ry...@ontko.com
Actually the problem here is that Inflater does not know it's finished because the
data is missing a single "dummy" byte that is required when Inflater is constructed
with "new Inflater(true)". This is in the JavaDoc for the Inflater constructor [
http://java.sun.com/j2se/1.4.2/docs/api/java/util/zip/Inflater.html#Inflater(boolean) ].

The fix simply involves copying the byte array and tacking a single null byte on to
the end.

I've attached a fix that does just this.

PROPER-INFLATER-USAGE-PATCH
1.1 KB   View   Download
Jun 23, 2015
#5 ashun...@gmail.com
I face the same issue with inflater code. My byte size is 40000 and is required to store dbcs chars. I did add the dummy byte at the end, however, the fix is sporadic. Sometimes it returns true and sometimes not!
So could you please let me know why it works with less byte array size when it is around 200 - 1000 and not with more. 

Powered by Google Project Hosting