Class that implements Lempel-Ziv compression.
LZ compression, also known as sliding window compression, uses redundancy to compress data. As input data is read, a dictionary of previous data is kept in memory. If a string of characters in the input data matches an entry in the dictionary, a code pointing to the dictionary entry is written to the output. If a match is not found in the dictionary the plain character is sent to the output.
|
Procedure Name
|
Type
|
Description
|
|
(Declarations)
|
Declarations
|
Declarations and private variables for the CLZ class
|
|
InputFileName
|
Property
|
Sets the name of the input file
|
|
OutputFileName
|
Property
|
Gets the name of the output file
|
|
BitSetByte
|
Private
|
Sets a bit in a byte variable
|
|
BufLength
|
Private
|
Returns the length of an entry
|
|
BufPosition
|
Private
|
Returns the window position of an entry
|
|
Compress
|
Method
|
Compresses the input file to the output file
|
|
CompressionInitialize
|
Private
|
Initializes the module variables for the compression and decompression routines
|
|
CompressString
|
Method
|
Compresses an input string
|
|
dblToLong
|
Private
|
Performs an unsigned conversion from a Double value to a Long value.
This function correctly handles doubles greater than 2,147,483,647 and less than or equal to 4,294,967,295.
|
|
Decompress
|
Method
|
Decompresses the input file to the output file
|
|
DecompressString
|
Method
|
Decompresses a string that was previously compressed with the CompressString method of this class
|
|
DeletePosition
|
Private
|
Removes a character from the window
|
|
FindMatch
|
Private
|
Searches for a match in the window
|
|
HiByte
|
Private
|
Returns the high byte of the passed integer
|
|
HiWord
|
Private
|
Returns the high integer of the passed long
|
|
InsertPosition
|
Private
|
Insert a character into the window
|
|
IntToByte
|
Private
|
Perform an unsigned conversion from an integer value to a byte. This handles any integer value.
|
|
IntToLong
|
Private
|
This routine converts an integer value to a long value, treating the integer as unsigned.
For example, performing the following assignment
lngNumber = -1
assigns -1 to the variable lngNumber. However, This assignment
lngNumber = IntToLong(-1)
assigns 65,535 to lngNumber.
|
|
LoByte
|
Private
|
Returns the low byte of the passed integer
|
|
LongToInt
|
Private
|
This routine does an unsigned conversion from a long value to an integer value.
|
|
LoWord
|
Private
|
Returns the low integer of the passed long
|
|
Shlb
|
Private
|
Shifts a numeric value left the specified number of bits.
Left shifting can be defined as a multiplication operation. For the number of bits we want to shift a value to the left, we need to raise two to that power, then multiply the result by our original value.
|
|
Shli
|
Private
|
Shifts a numeric value left the specified number of bits.
Left shifting can be defined as a multiplication operation. For the number of bits we want to shift a value to the left, we need to raise two to that power, then multiply the result by our original value.
|
|
Shll
|
Private
|
Shifts a numeric Value left the specified number of bits.
Left shifting can be defined as a multiplication operation. For the number of bits we want to shift a value to the left, we need to raise two to that power, then multiply the result by our original value.
|
|
Shri
|
Private
|
Shifts a Long value right the selected number of places.
Right shifting can be defined as a division operation. For the number of bits we want to shift a value to the right, we need to raise two to that power, then our original value by the result
|
|
WriteBufferByte
|
Private
|
Writes a single byte to the output buffer
|
|
WriteBufferEntry
|
Private
|
Writes a window entry to the output buffer
|
|
WriteBufferFinish
|
Private
|
Flushes any remaining data to the output buffer
|
|
WriteByte
|
Private
|
Writes a single byte to the output file
|
|
WriteEntry
|
Private
|
Writes a window entry to the output file
|
|
WriteFinish
|
Private
|
Flushes any remaining data to the output file
|