You Are Here:

Community: Developer Discussion Boards

#1 Old Datacompression --> text in a jar - 2004-11-14, 18:23

Join Date: May 2003
Posts: 39
JWtheCoolOne
Offline
Registered User
Hello,

I'm searching for an effective way to store some text information in a jar file. Is there a good way to encode text before it gets zipped in the jar of a j2me application to reduce the resulting jar size?

Some links, articles or sample source code for de- en- coding would be great..

Thanks !!
Jan
Reply With Quote

#2 Old 2004-12-09, 20:11

Join Date: Mar 2003
Posts: 63
Location: Norway
skjolber's Avatar
skjolber
Offline
Regular Contributor
You'd be wasting your time. Information theory is heavy stuff and the zip algoritm is pretty optimal.

An alternative might be to use better zip compression (jar is zip), I have tried it a couple of times and not had any problems.

Thomas
Reply With Quote

#3 Old 2004-12-10, 17:38

Join Date: May 2003
Posts: 151
Danack
Offline
Regular Contributor
skjolber is correct and you are unlikely to be able to beat zip compression however.....

It depends on your text - if it's a lot of text that is very repetitive you might be able to beat the zip compression by making your own dictionary of words and then storing indices rather than words.

eg
String []aszDictionary =
{
". ",
"See",
"Spot",
"run",

};


int []nMyFirstBook =
{
1, 2, 0, 1, 2, 3, 0, 3, 2, 3,
};


Which obviously has a chance of beating zip compression.


cheers
Danack
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia