Beispiel #1
0
        public byte[] Decode(byte[] content)
        {
            var lzw    = new LZWDecompress();
            var input  = Encoding.ASCII.GetString(content);
            var output = lzw.Decompress(input);

            return(output);
        }
Beispiel #2
0
        public SourceFile Run(EncodedFile encoded, string outputPath)
        {
            var lzwDecoder     = new LZWDecompress();
            var huffmanDecoder = new HuffmanDecoder(encoded.Header.HuffmanMetadata);

            var bytes   = encoded.Content.ToArray();
            var decoded = huffmanDecoder.Decode(bytes);
            var input   = Encoding.ASCII.GetString(decoded);
            var outLzw  = lzwDecoder.Decompress(input);

            return(new SourceFile(outputPath, outLzw, encoded.Header.SourceExtension));
        }