- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# HuffmanEncodingTree Class Reference

This generates special cases of the huffman encoding tree using 8 bit keys with the additional condition that unused combinations of 8 bits are treated as a frequency of 1. More...

`#include <DS_HuffmanEncodingTree.h>`

List of all members.

## Public Member Functions
void | EncodeArray (unsigned char *input, unsigned sizeInBytes, RakNet::BitStream *output)
unsigned | DecodeArray (RakNet::BitStream *input, unsigned sizeInBits, unsigned maxCharsToWrite, unsigned char *output)
void | DecodeArray (unsigned char *input, unsigned sizeInBits, RakNet::BitStream *output)
void | GenerateFromFrequencyTable (unsigned int frequencyTable[256])
| Given a frequency table of 256 elements, all with a frequency of 1 or more, generate the tree.
void | FreeMemory (void)
| Free the memory used by the tree.
## Private Member Functions
void | InsertNodeIntoSortedList (HuffmanEncodingTreeNode *node, DataStructures::LinkedList< HuffmanEncodingTreeNode * > *huffmanEncodingTreeNodeList) const
## Private Attributes
HuffmanEncodingTreeNode * | root
| The root node of the tree.
CharacterEncoding | encodingTable [256]
## Classes
struct | CharacterEncoding
| Used to hold bit encoding for one character. More...

## Detailed Description

This generates special cases of the huffman encoding tree using 8 bit keys with the additional condition that unused combinations of 8 bits are treated as a frequency of 1.

## Member Function Documentation

void HuffmanEncodingTree::EncodeArray | ( | unsigned char * | input,
|  | unsigned | sizeInBytes,
|  | RakNet::BitStream * | output
| ) |

  | Pass an array of bytes to array and a preallocated BitStream to receive the output Parameters:
  `[in]` | input | Array of bytes to encode
  `[in]` | sizeInBytes | size of input
  `[out]` | output | The bitstream to write to

The documentation for this class was generated from the following files:

- C:/RakNet 2.518/Include/DS_HuffmanEncodingTree.h
- C:/RakNet 2.518/Source/DS_HuffmanEncodingTree.cpp