adityalalu / google-apps-sso-sample

Automatically exported from code.google.com/p/google-apps-sso-sample
Apache License 2.0
0 stars 0 forks source link

Java sample uses Inflater.finished() which doesn't work as expected #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by acc%goog...@gtempaccount.com on 21 Dec 2007 at 6:35

GoogleCodeExporter commented 9 years ago

Original comment by acc%goog...@gtempaccount.com on 21 Dec 2007 at 6:35

GoogleCodeExporter commented 9 years ago

Original comment by acc%goog...@gtempaccount.com on 21 Dec 2007 at 6:35

GoogleCodeExporter commented 9 years ago

Original comment by acc%goog...@gtempaccount.com on 21 Jun 2008 at 6:10

GoogleCodeExporter commented 9 years ago
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(boo
lean) ].

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.

Original comment by ry...@ontko.com on 28 Aug 2008 at 12:17

Attachments: