压缩java libs替代pack200和jnlp [英] compress java libs alternative pack200 and jnlp

查看:124
本文介绍了压缩java libs替代pack200和jnlp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我有一个很大的应用程序,我使用jnlp文件从网上启动我的应用程序,然后使用pack200来压缩它,并且下载速度更快。但是,由于我的应用程序变得越来越大(大约35-45mb),有时候pack200只是挂出,或者有时候,jnlp下载器挂出,jnlp和pack200有更好的选择吗?

Hello, i have a big application, i launch my app from the web using a jnlp file, and pack200 to compress it, and download faster. But since my app is getting bigger (about 35-45mb), some times pack200 just hang out, or some times, the jnlp downloader hang out, is there an alternative better to jnlp and pack200?

推荐答案

Pack200和deflate是java开箱即用的唯一支持。虽然您可以编写从其他存档格式(如BZip2或7z(LZMA)读取的 Classloader ,但它需要存在于启动存根小程序中,其中包含Classloader,下载包含主应用程序的存档,从中加载类并启动应用程序。



使用Bzip2或LZMA,您可以获得比pack200更好的压缩率,高达~50%



参见 this [ ^ ]



它解释了如何从jar加载,但可以使用相同的方法加载其他类型的档案,看看Apache的Commons Compress,它对各种档案类型提供了很好的支持。



好​​运!
Pack200 and "deflate" are the only ones that are supported in java out-of-the-box. Though you can write a Classloader that reads from other archive format such as BZip2 or 7z (LZMA), it requires to be present in a start-up stub applet, that contains the Classloader, downloads the archive containing main application, loads the classes from it and starts the app.

With Bzip2 or LZMA, you can get a better compression ratio than pack200, upto ~50%

See this[^]

It explains how to load from a jar, but same approach can be used to load from other types of archives too, take a look at Apache's Commons Compress, it has nice support for various archive types.

Good Luck!


这篇关于压缩java libs替代pack200和jnlp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆