public void Decode(IDecoderInput input, IDecoderOutput <T> output) { while (!output.IsEnd()) { input.Read(); output.Write(symbol); } }
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; } } }