예제 #1
0
파일: Decoder.cs 프로젝트: ZalkinV/CT.Lab1
        public static IList <byte> Huffman(HuffmanResult huffmanResult)
        {
            var huf = new Huffman();

            huf.BuildCodes(huffmanResult.BytesCounts);
            var hufResult = huf.Decode(huffmanResult.Bits);

            return(hufResult);
        }
예제 #2
0
파일: Encoder.cs 프로젝트: ZalkinV/CT.Lab1
        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);
        }