Click here to Skip to main content
11,412,451 members (66,222 online)
Click here to Skip to main content

LZW Compression Algorithm Implemented in Java

, 13 Aug 2006 CPOL
Rate this:
Please Sign up or sign in to vote.
This article provides an implementation of the LZW compression algorithm in Java

Introduction

I recently had the opportunity to look into compression for a project. I had to implement the Lempel-Ziv-Welch (LZW) algorithm for mobile phones in J2ME but before that, I implemented it in Java for testing purposes.

I wish to thank Mark Nelson for pointing out that the Unisys patent on this algorithm has expired, so there are fewer headaches in the use of this algorithm.

Description

This implementation is actually based on the C version of the implementation by Mark Nelson at http://marknelson.us/1989/10/01/lzw-data-compression/. Please refer to this website for further details about the algorithm. The Java adaptation is designed to work for ASCII encoded text files.

History

  • 13th August, 2006: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

fahadkhowaja
Web Developer
Singapore Singapore
No Biography provided

Comments and Discussions

 
Questionlzw decompression algorithm Pin
Member 11460513 at 17-Feb-15 22:25
memberMember 1146051317-Feb-15 22:25 
QuestionNice topic Pin
sanya.fesak at 21-Sep-11 20:01
membersanya.fesak21-Sep-11 20:01 
Generallzw in matlab Pin
hana.rahmati at 30-Apr-10 23:14
memberhana.rahmati30-Apr-10 23:14 
Questionalgorithm for n-queen Pin
hana.rahmati at 30-Apr-10 22:38
memberhana.rahmati30-Apr-10 22:38 
GeneralI download your souce code and I have J creator and net beams install how do I run this file to test it Pin
Bulitpruf at 7-Aug-09 8:53
memberBulitpruf7-Aug-09 8:53 
GeneralRe: I download your souce code and I have J creator and net beams install how do I run this file to test it Pin
mitesh3555 at 19-Jan-10 18:15
membermitesh355519-Jan-10 18:15 
Generalhelp me to implementing the "dynamic markov compression of C version" to Java (JSDK) and J2me version.. :( Pin
bytescode at 28-Apr-09 2:39
memberbytescode28-Apr-09 2:39 
QuestionCan you also provide the decompression method Pin
pakhtoon at 18-Nov-07 13:43
memberpakhtoon18-Nov-07 13:43 
AnswerRe: Can you also provide the decompression method Pin
manishaswati at 30-Aug-08 4:26
membermanishaswati30-Aug-08 4:26 
AnswerRe: Can you also provide the decompression method Pin
duraigowardhan at 1-Oct-09 6:05
memberduraigowardhan1-Oct-09 6:05 
QuestionRe: Can you also provide the decompression method Pin
skumarmails at 17-Jan-10 23:47
memberskumarmails17-Jan-10 23:47 
AnswerRe: Can you also provide the decompression method Pin
guyver.nihilith at 14-Feb-10 6:24
memberguyver.nihilith14-Feb-10 6:24 
QuestionTABLE_SIZE Pin
GordonMorgan at 4-May-07 6:55
memberGordonMorgan4-May-07 6:55 
Generalurgent Pin
simarjeet at 26-Apr-07 6:47
membersimarjeet26-Apr-07 6:47 
GeneralRe: urgent Pin
Kusmadi Cakep at 8-Jan-10 21:35
memberKusmadi Cakep8-Jan-10 21:35 
GeneralJ2ME for LZW Pin
fur128 at 20-Mar-07 5:32
memberfur12820-Mar-07 5:32 
GeneralRe: J2ME for LZW Pin
ed welch at 3-Jun-07 8:47
membered welch3-Jun-07 8:47 
GeneralLZW in VC++ Pin
mannur at 28-Feb-07 5:27
membermannur28-Feb-07 5:27 
Generalrequest Pin
rancidbondut at 19-Feb-07 9:03
memberrancidbondut19-Feb-07 9:03 
GeneralRe: LZW for J2ME Pin
fahadkhowaja at 16-Feb-07 3:09
memberfahadkhowaja16-Feb-07 3:09 
Generallzw for j2me Pin
scntuan at 10-Sep-06 8:26
memberscntuan10-Sep-06 8:26 
GeneralCongratulations and to follow !!! Pin
Pipa_Soft at 15-Aug-06 6:41
memberPipa_Soft15-Aug-06 6:41 
GeneralRe: Congratulations and to follow !!! Pin
pakhtoon at 18-Nov-07 13:47
memberpakhtoon18-Nov-07 13:47 
GeneralRe: Congratulations and to follow !!! Pin
skumarmails at 17-Jan-10 23:34
memberskumarmails17-Jan-10 23:34 
Generallzw copyright Pin
snorkelman at 13-Aug-06 8:33
membersnorkelman13-Aug-06 8:33 
GeneralRe: lzw copyright Pin
fahadkhowaja at 13-Aug-06 8:47
memberfahadkhowaja13-Aug-06 8:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150427.1 | Last Updated 13 Aug 2006
Article Copyright 2006 by fahadkhowaja
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid