Example #1
0
 public void Decode(IDecoderInput input, IDecoderOutput <T> output)
 {
     while (!output.IsEnd())
     {
         input.Read();
         output.Write(symbol);
     }
 }
Example #2
0
 private void Decode(IDecoderInput input, IDecoderOutput <T> output, IHuffmanTreeNode <T> currentNode)
 {
     while (!output.IsEnd())
     {
         var bit = input.Read();
         currentNode = bit ? currentNode.RightChild : currentNode.LeftChild;
         if (currentNode.IsLeaf)
         {
             output.Write(currentNode.Value);
             currentNode = root;
         }
     }
 }