-
Notifications
You must be signed in to change notification settings - Fork 599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove jzlib dependency #772
Conversation
Codecov Report
@@ Coverage Diff @@
## master #772 +/- ##
============================================
+ Coverage 64.88% 64.89% +0.01%
+ Complexity 1469 1465 -4
============================================
Files 210 210
Lines 8537 8523 -14
Branches 781 780 -1
============================================
- Hits 5539 5531 -8
+ Misses 2591 2582 -9
- Partials 407 410 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Unfortunately I do not think this will work. Zip is different from zlib and both algorithms are unable to read eachother's data. |
Yes, a PKZip file is a different format from a Gzip file. But technically both use the "deflate" algorithm internally. Long ago, the JRE didn't contain tools for dealing directly with gzip/zlib style "deflate" streams (Java of course has supported access to PKZIP files since the beginning, since that's what .JARs are). As of Java 6 or so, (apparently as part of adding PNG support), classes were made available inside Additionally, I have tested this myself against an OpenSSH Docker container by doing this to force the use of my Zlib implementation (note the absence of the "NoneCompression.Factory"):
Give it a try -- it works for me 😁 |
I dug into the history a little more - it actually looks like zlib deflate/inflate support has been available in The only reason the jCraft jzlib project was even created was because the JRE implementation didn't yet support partial-flush mode, as explained here: This deficiency was eventually fixed in Java 7 with the introduction of the 4-argument The Java bug report about this is here (and confirms that it was fixed as of JDK 7): So I suppose if you are intending to still support Java 6 for now, maybe you can't merge this yet, but as soon as you are targeting Java 7 and above, this PR should be usable. |
Is there a chance that this PR moves forward? Apache Mina Sshd did the same a while ago: apache/mina-sshd@ea72a9e |
It looks like Java 7 may have already been a requirement since this commit: 3526694#diff-49a96e7eea8a94af862798a45174e6ac43eb4f8b4bd40759b5da63ba31ec3ef7R88 So I'm not aware of any reason this shouldn't be mergeable at this point. @hierynomus , do you have any remaining concerns? |
The JRE already contains a gzip implementation in
java.util.zip.*
, so we should be able to use that rather than relying on the external jCraft library.