Esempio n. 1
0
 private bool ProcessCode(int code, byte[] buffer, int offset, int count, ref int read)
 {
     if (code < this._codeTable.Count)
     {
         LzwDecompressStream.Sequence sequence = this._codeTable[code];
         if (sequence.IsStopCode)
         {
             return(false);
         }
         if (sequence.IsClearCode)
         {
             this.InitCodeTable();
             return(true);
         }
         this._remainingBytes = LzwDecompressStream.CopySequenceToBuffer(sequence.Bytes, buffer, offset, count, ref read);
         if (this._prevCode >= 0)
         {
             this._codeTable.Add(this._codeTable[this._prevCode].Append(sequence.Bytes[0]));
         }
     }
     else
     {
         LzwDecompressStream.Sequence sequence1 = this._codeTable[this._prevCode];
         LzwDecompressStream.Sequence local     = sequence1;
         //int num = (int)local.Bytes[0];
         LzwDecompressStream.Sequence sequence2 = (local).Append(/*(byte)num*/ local.Bytes[0]);
         this._codeTable.Add(sequence2);
         this._remainingBytes = LzwDecompressStream.CopySequenceToBuffer(sequence2.Bytes, buffer, offset, count, ref read);
     }
     this._prevCode = code;
     return(true);
 }
Esempio n. 2
0
 private void FlushRemainingBytes(byte[] buffer, int offset, int count, ref int read)
 {
     if (this._remainingBytes == null)
     {
         return;
     }
     this._remainingBytes = LzwDecompressStream.CopySequenceToBuffer(this._remainingBytes, buffer, offset, count, ref read);
 }