コード例 #1
0
 public void Decode(IDecoderInput input, IDecoderOutput <T> output)
 {
     while (!output.IsEnd())
     {
         input.Read();
         output.Write(symbol);
     }
 }
コード例 #2
0
ファイル: HuffmanDecoder.cs プロジェクト: wziel/HuffmanCoder
 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;
         }
     }
 }
コード例 #3
0
ファイル: LzwDecoder.cs プロジェクト: joelpitk/pitpack
 /// <summary>
 /// Constructs a new LzwDecoder instance with the given input, output and string table instances.
 /// </summary>
 /// <param name="input">An IDecoderInput implementation to read codes from.</param>
 /// <param name="output">An IDecoderOutput implementation to write strings to.</param>
 /// <param name="stringTable">An IStringTable implementation to translate read codes into strings.</param>
 public LzwDecoder(IDecoderInput input, IDecoderOutput output, IStringTable stringTable)
 {
     this.input = input;
     this.output = output;
     this.stringTable = stringTable;
 }
コード例 #4
0
ファイル: HuffmanDecoder.cs プロジェクト: wziel/HuffmanCoder
 public void Decode(IDecoderInput input, IDecoderOutput <T> output)
 {
     Decode(input, output, root);
 }