public static IList <byte> Huffman(HuffmanResult huffmanResult) { var huf = new Huffman(); huf.BuildCodes(huffmanResult.BytesCounts); var hufResult = huf.Decode(huffmanResult.Bits); return(hufResult); }
public static HuffmanResult Huffman(IList <byte> bytes) { var huf = new Huffman(); huf.CountBytes(bytes); huf.BuildCodes(); var hufResult = huf.Encode(bytes); var result = new HuffmanResult( bytesCounts: huf.Counts, bits: hufResult); return(result); }