public void Encode() { Dictionary <byte, int> symbolQuantityDic = createDictionary(); var builder = new HuffmanCodecBuilder <byte>(); var tree = builder.BuildTree(Comparer <byte> .Default, symbolQuantityDic); ICoder <byte> huffmanCoder = builder.GetCoder(tree); huffmanCoder.Encode(new StandardHuffmanCoderInput(inputReader), new HuffmanCoderOutput(coderOutputWriter)); coderOutputWriter.CreateFileBytes(HuffmanEncodeModel.Standard, false, SymbolQuantityMapConverter.StandardIntToExtConvert(symbolQuantityDic, huffmanCoder.GetEncodingDictionary())); }