473,545 Members | 1,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compression algorithm

I not really sure this is the right newsgroup so please excuse me if it
is not.

I am trying to create a simple compression algorithm using the LZW
system and I can find a lot of information on the general description of
it, but how exactly does the dictionary that is used work. Is it just
stored in an array or do you need to write it to a file so that it can
be used the next time you need to decompress a file. I would think it
would need to be stored in a file and then read into an array since if
you compressed the file and then shut down the program, would you not
lose everything in the dictionary and then not be able to decompress the
file? Any help would be appreciated.

Thanks,

Z.K.
May 21 '06 #1
1 3132
Z.K. wrote:
I am trying to create a simple compression algorithm using
the LZW system and I can find a lot of information on the
general description of it, but how exactly does the dictionary
that is used work. [...] I would think it would need to be
stored in a file and then read into an array since if you
compressed the file and then shut down the program, would
you not lose everything in the dictionary and then not be able
to decompress the file?


No, the decompression algorithm reconstructs the dictionary from the
compressed data.

Eq.
May 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
2043
by: c3poptuse | last post by:
Supercomputer and encryption and compression @ rate of 96% Take a document then or a 3D matrix document change it two random or binary code or just a program for 0's and 1's and fold it over and over like a piece of paper then having the 1 and 0 add each other or the 0,1's canceling each other out 1+0=0 and 0+1=1 1+1=1 0+0=0 if you gave the...
2
409
by: Jim Hubbard | last post by:
I went to the compression newsgroups, but all I saw was spam. So, I thought I'd post his question here to get the best info I could from other programmers. Which compression algorithm offers the fastest compression of text data? Which compression algorithm offers the best compression of text data? I need to do in memory compression of...
8
5635
by: dirgesh | last post by:
I am having a hard time making a Program in C/C++ that uses the Huffman Compression to compress a file. I have a file "Hello World" That i need to compress. can someone please give me an example of how to do it with huffman compression.
17
3137
by: dunric | last post by:
After writing the computing urban legend "The Helsinki Code", I spent several nights thinking up how in the world Gustav Larsson, the Finnish PDP-8 computer programmer, could have managed to receive such a miraculous message from God. Surely, for a 1-byte computer program such as "@" to compile successfully (in RTPS FORTRAN), a miracle...
2
2481
by: TerryStone | last post by:
Thanks to anyone who reads this. Below is some C# that compresses an array of bytes, and then decompresses, and compares the original data with the new. Firstly, the length of the decompressed data is shorter than the original. So some loss of data has occured. But the content up until the early truncation matches. So am I flushing...
5
5950
by: jeremyje | last post by:
I'm writing some code that will convert a regular string to a byte for compression and then beable to convert that compressed string back into original form. Conceptually I have.... For compression string ->(Unicode Conversion) byte -(Compression + Unicode Conversion) string
21
5982
by: =?Utf-8?B?VkJB?= | last post by:
I compressed a file with GZipStream class and is larger than the original file.... how can this be?, the original file is 737 KB and the "compressed" file is 1.1 MB. Did i miss something or is normal with that compression class? -- VBA
7
17209
by: pamela fluente | last post by:
I have been using something like: public void SaveJPG(Image Image, string FileName, long QualityLevel_0_100, long ColorDepthLevel) { ImageCodecInfo ImageCodecInfoJPG = GetEncoderInfo("image/jpeg"); EncoderParameters EP = new EncoderParameters(2); EP.Param(0) = new EncoderParameter(Encoder.Quality, QualityLevel_0_100); EP.Param(1) = new...
3
2019
by: Stephany Young | last post by:
Does anyone have the source code for a C# implementation of the AR2000 Compression/Decompression algorithm that they might like to share?
9
2688
by: csharpula csharp | last post by:
Hello, I would like to know which one of the following compressiom methods are the easiest to implement in c# and the most effective one in compression of files? (text or code files) Which one of those: zip, tar, tar.gz, gz. ? And is there any code sample in C# of the API with compression? Thank you!
0
7459
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7393
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7803
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7411
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7749
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5965
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3444
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3439
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1012
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.