Israel Ors' HuffmanAlgorithm Documentation

HuffmanAlgorithm Members

HuffmanAlgorithm overview

Public Instance Constructors

HuffmanAlgorithm Constructor Initializes a new instance of the HuffmanAlgorithm class.

Public Instance Methods

Dispose 
Equals (inherited from Object) Determines whether the specified Object is equal to the current Object.
ExtractOverloaded. Build a frequency table and Huffman tree and extract the archive.
ExtractWithProgressOverloaded. Build a frequency table and Huffman tree and extract the archive. This function version, calls the PercentComplete event handler When anothe 1 percent compleated.
GetArchivingRatio This function calculates the the archiving ratio of a given archived stream.
GetHashCode (inherited from Object) Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) Gets the Type of the current instance.
IsArchivedStream Checks if a data stream is archived.
IsPasswardProtectedStream Checks if a given archived data stream is password protected.
ShrinkOverloaded. Build a frequency table and Huffman tree and shrinking the stream data.
ShrinkWithProgressOverloaded. Build a frequency table and Huffman tree and shrinking the stream data. This function version, calls the PercentComplete event handler When anothe 1 percent compleated.
ToString (inherited from Object) Returns a String that represents the current Object.

Public Instance Events

PercentCompleted This is Asynchronic event and invoked only from xxxxWithProgress functions. Invoked whenever another 1 percent of the function is done.
WrongPassword This is Asynchronic event and accures when the Extract function returns on wrong password error. Invoked whenever attempt to extract password protected file\stream, by using the wrong password(Fatal error). In case this event isn't handaled by the users an exeption will be thrown(in password error case).

Protected Instance Methods

Finalize (inherited from Object) Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

Private Instance Fields

AmountListHolds the amount of repetitions of byte.
BinFormatUses to write and read the Headers to and from a stream.
BitsListI use this list to write the reverse path to a Byte.
ByteLocation This is a temporary array to sign where it's location in the BuildFrequencyTable function (the value is the location.
BytesListHolds the bytes that where found.
IsByteExist This array indicated if the byte with the value that correspond to the index of the array (0-255) was found or not in the stream.
StackThis stack is used to write extracted and shrinked bytes.

Private Instance Methods

BuildFrequencyTable Scanning for repeated bytes and according to them build frequency table.
GetComplementsBits Calculates the amount of complements bits, needed for the last byte writing.
PasswordGen This function takes a password cstring and converts it to a ushort number that's fit the header of a shrinked file.
SortArrays Bouble sort FrequencyTable( according frequency level ) and making the same changes on the corresponding array.
WriteHeader Write a header to the stream. This header is vital when extracting the data.

See Also

HuffmanAlgorithm Class | JadBenAutho.Tools Namespace