C# 클래스 ME3Explorer.HuffmanCompression

파일 보기 프로젝트 열기: ME3Explorer/ME3Explorer 1 사용 예제들

공개 메소드들

메소드 설명
LoadInputData ( string fileName, bool debugVersion ) : void

Loads a file into memory and prepares for compressing it to TLK

SaveToTlkFile ( string fileName ) : void

Dumps data from memory to TLK compressed file format. Compressed data should be read into memory first, by LoadInputData method.

비공개 메소드들

메소드 설명
BitArrayListToByteArray ( List bitsList, int bitsCount ) : byte[]

Converts bits in a BitArray to an array with bytes. Such array is ready to be written to a file.

BuildCodingArray ( ) : void

Using Huffman Tree (created with BuildHuffmanTree method), generates a binary code for every character.

BuildHuffmanTree ( ) : void

Standard implementation of builidng a Huffman Tree

CompareNodes ( HuffmanNode L1, HuffmanNode L2 ) : int

For sorting Huffman Nodes

ConvertHuffmanTreeToBuffer ( ) : List

Converts a Huffman Tree to it's binary representation used by TLK format of Mass Effect 2.

LoadTxtInputData ( string fileName ) : void
LoadXmlInputData ( string fileName, bool debugVersion ) : void

Loads data from XML file into memory

PrepareHuffmanCoding ( ) : void

Creates Huffman Tree based on data from memory. For every character in text data, a corresponding Huffman Code is prepared. Source: http://en.wikipedia.org/wiki/Huffman_coding

TraverseHuffmanTree ( HuffmanNode node, List code ) : void

Recursively traverses Huffman Tree and generates codes

메소드 상세

LoadInputData() 공개 메소드

Loads a file into memory and prepares for compressing it to TLK
public LoadInputData ( string fileName, bool debugVersion ) : void
fileName string
debugVersion bool
리턴 void

SaveToTlkFile() 공개 메소드

Dumps data from memory to TLK compressed file format. Compressed data should be read into memory first, by LoadInputData method.
public SaveToTlkFile ( string fileName ) : void
fileName string
리턴 void