一聚教程网:一个值得你收藏的教程网站

热门教程

LZW算法的 C#实现

时间:2022-07-02 11:12:48 编辑:袖梨 来源:一聚教程网

#undef debug
#define debugdisplay
#undef debugdictionary
using System;
using System.Collections;
namespace LZW
{
 public class cLZW
 {
    #region Constrcut
    public cLZW()
    {
    }
    #endregion
    
    #region Coding
    public string InCharStream
    {
     set { _InCharStream = value; }
     get {return _InCharStream; }
    }
    public ArrayList CodingCodeStream
    {
     get {return _CodingCodeStream;}
    }
    public ArrayList CodingDictionary
    {
     get {return _CodingDictionary;}
    }
    private void InitCodingDictionary()
    {
     _CodingDictionary.Clear();
#if debug
     _CodingDictionary.Add("A");
     _CodingDictionary.Add("B");
     _CodingDictionary.Add("C");
#else
     for(int i = 0; i < 256; i++)
     {
    _CodingDictionary.Add((char)i);

热门栏目