/// <summary>
 /// constructor
 /// </summary>
 /// <param name="slidingWindow">the target sliding window</param>
 public HashTable(SlidingWindow slidingWindow)
 {
     this.slidingWindow = slidingWindow;
     for (int i = 0; i < table.Length; i++)
     {
         table[i] = new List<int>();
     }
 }
예제 #2
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="slidingWindow">the target sliding window</param>
 public HashTable(SlidingWindow slidingWindow)
 {
     this.slidingWindow = slidingWindow;
     for (int i = 0; i < table.Length; i++)
     {
         table[i] = new List <int>();
     }
 }
 /// <summary>
 /// constructor with mode specified
 /// </summary>
 /// <param name="mode">indicates which mode are used</param>
 public Decompressor(SlidingWindowSize mode)
 {
     this.mode = mode;
     if (mode == SlidingWindowSize.EightKB)
     {
         historyBuffer = new SlidingWindow(window8k);
     }
     else if (mode == SlidingWindowSize.SixtyFourKB)
     {
         historyBuffer = new SlidingWindow(window64k);
     }
     else
     {
         throw new ArgumentException(
             "mode should be EightKB or SixtyFourKB", "mode");
     }
     decodeState = DecodeState.Init;
 }
 /// <summary>
 /// constructor with specified sliding window size
 /// </summary>
 /// <param name="mode">the mode of compressor, specify the size of sliding window</param>
 public Compressor(SlidingWindowSize mode)
 {
     this.mode = mode;
     if (mode == SlidingWindowSize.EightKB)
     {
         slidingWindow = new SlidingWindow(window8k);
     }
     else if (mode == SlidingWindowSize.SixtyFourKB)
     {
         slidingWindow = new SlidingWindow(window64k);
     }
     else
     {
         throw new ArgumentException(
                   "mode should be EightKB or SixtyFourKB", "mode");
     }
     hashTable = new HashTable(slidingWindow);
 }
 /// <summary>
 /// constructor with specified sliding window size 
 /// </summary>
 /// <param name="mode">the mode of compressor, specify the size of sliding window</param>
 public Compressor(SlidingWindowSize mode)
 {
     this.mode = mode;
     if (mode == SlidingWindowSize.EightKB)
     {
         slidingWindow = new SlidingWindow(window8k);
     }
     else if (mode == SlidingWindowSize.SixtyFourKB)
     {
         slidingWindow = new SlidingWindow(window64k);
     }
     else
     {
         throw new ArgumentException(
             "mode should be EightKB or SixtyFourKB", "mode");
     }
     hashTable = new HashTable(slidingWindow);
 }
 /// <summary>
 /// constructor with mode specified
 /// </summary>
 /// <param name="mode">indicates which mode are used</param>
 public Decompressor(SlidingWindowSize mode)
 {
     this.mode = mode;
     if (mode == SlidingWindowSize.EightKB)
     {
         historyBuffer = new SlidingWindow(window8k);
     }
     else if (mode == SlidingWindowSize.SixtyFourKB)
     {
         historyBuffer = new SlidingWindow(window64k);
     }
     else
     {
         throw new ArgumentException(
                   "mode should be EightKB or SixtyFourKB", "mode");
     }
     decodeState = DecodeState.Init;
 }