Example #1
0
 /// <summary>
 /// Parses the window from the data
 /// </summary>
 /// <param name="dictionarySize">the dictionary size</param>
 /// <param name="buffer">the buffer containing the incoming data</param>
 public WindowDecoder(long dictionarySize, IByteBuffer buffer)
 {
     this.dictionarySize = dictionarySize;
     this.buffer         = buffer;
     chunk  = new ParseableChunk(buffer.Position, buffer.Length);
     Result = (int)VCDiffResult.Succes;
 }
Example #2
0
        /// <summary>
        /// Parses the window from the data
        /// </summary>
        /// <param name="dictionarySize">the dictionary size</param>
        /// <param name="buffer">the buffer containing the incoming data</param>
        /// <param name="maxWindowSize">The maximum target window size in bytes</param>
        public WindowDecoder(long dictionarySize, TByteBuffer buffer, int maxWindowSize = DefaultMaxTargetFileSize)
        {
            this.dictionarySize = dictionarySize;
            this.buffer         = buffer;
            chunk = new ParseableChunk(buffer.Position, buffer.Length);

            if (maxWindowSize < 0)
            {
                throw new ArgumentException("maxWindowSize must be a positive value", "maxWindowSize");
            }
            else
            {
                this.maxWindowSize = maxWindowSize;
            }

            returnCode = (int)VCDiffResult.SUCCESS;
        }