|
-
Jan 11th, 2003, 08:54 AM
#1
Thread Starter
Ex-Super Mod'rater
Compressing a Byte array [Resolved]
I have an array of Bytes and I need to compress it, no certain algorithm I just need to create an algorithm that will look for common patterns in the byte array then say replace them for a shorter pateren that is defined at the begining. The only problem is I don't know an algorithm that will definitely work, if someone has already done this it would be a grat help, otherwise I guess i'm going to have to do it from scratch.
Thanx for any help.
Last edited by Electroman; Jan 12th, 2003 at 07:41 AM.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Jan 11th, 2003, 10:05 AM
#2
PowerPoster
look up Hoffman encoding on the internet --- it's the most common compression algorithm and is fairly simple as compression algorithms go and you'll find tons of existing code examples.
-
Jan 11th, 2003, 01:54 PM
#3
Thread Starter
Ex-Super Mod'rater
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Jan 11th, 2003, 02:42 PM
#4
Try using the ZLib.dll, it's very easy to use... it has only 2 functions, compress/decompress
http://www.winimage.com/zLibDll/
http://www.gzip.org/zlib/
-
Jan 11th, 2003, 03:13 PM
#5
Thread Starter
Ex-Super Mod'rater
Isn't the ZLib.dll for files tho?
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Jan 11th, 2003, 05:52 PM
#6
Thread Starter
Ex-Super Mod'rater
I think its Huffman you meant not Hoffman. Anyway I found some source code at this link http://www.planet-source-code.com/xq...s/ShowCode.htm, I haven't tryed it just yet but if anyone else wants it theres the link.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Jan 11th, 2003, 10:30 PM
#7
ZLib.dll compresses data in memory, you can compress anything you whant...
-
Jan 12th, 2003, 03:23 AM
#8
Fanatic Member
Zlib uses the LZ77 algorithm. Information about this algorithm can be found here.
The LZ77 algorithm isn't proprietary, in contrary with LZW (used by GIF files).
-
Jan 12th, 2003, 03:25 AM
#9
Fanatic Member
Originally posted by Electroman
Isn't the ZLib.dll for files tho?
The only two differences between a file and a byte array I can think of is that a file is written to the disk and has a name. A file is still a bytearray imho, even text files.
-
Jan 12th, 2003, 05:47 AM
#10
Thread Starter
Ex-Super Mod'rater
I can't find ZLib.dll on my PC so i've downloaded a copy and it won't register, does anyone know why or can someone post a copy they know works cos it might jus be I'v got a dodgy dll.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Jan 12th, 2003, 07:40 AM
#11
Thread Starter
Ex-Super Mod'rater
Opps my fault, I didn't realise the ZLib procedures were APIs, I was expecting it to contain a class. Oh well thanx, problem solved.
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|