Ejemplo n.º 1
0
        public int CopyStored(StreamManipulator input, int length)
        {
            length = Math.Min(Math.Min(length, 32768 - this.windowFilled), input.AvailableBytes);
            int num = 32768 - this.windowEnd;
            int num2;

            if (length > num)
            {
                num2 = input.CopyBytes(this.window, this.windowEnd, num);
                if (num2 == num)
                {
                    num2 += input.CopyBytes(this.window, 0, length - num);
                }
            }
            else
            {
                num2 = input.CopyBytes(this.window, this.windowEnd, length);
            }
            this.windowEnd     = (this.windowEnd + num2 & 32767);
            this.windowFilled += num2;
            return(num2);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Copy from input manipulator to internal window
        /// </summary>
        /// <param name="input">source of data</param>
        /// <param name="length">length of data to copy</param>
        /// <returns>the number of bytes copied</returns>
        public int CopyStored(StreamManipulator input, int length)
        {
            length = Math.Min(Math.Min(length, WindowSize - windowFilled), input.AvailableBytes);
            int copied;

            int tailLen = WindowSize - windowEnd;

            if (length > tailLen)
            {
                copied = input.CopyBytes(window, windowEnd, tailLen);
                if (copied == tailLen)
                {
                    copied += input.CopyBytes(window, 0, length - tailLen);
                }
            }
            else
            {
                copied = input.CopyBytes(window, windowEnd, length);
            }

            windowEnd     = (windowEnd + copied) & WindowMask;
            windowFilled += copied;
            return(copied);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Copy from input manipulator to internal window
        /// </summary>
        /// <param name="input">source of data</param>
        /// <param name="length">length of data to copy</param>
        /// <returns>the number of bytes copied</returns>
        public int CopyStored(StreamManipulator input, int length)
        {
            length = Math.Min(Math.Min(length, WindowSize - windowFilled), input.AvailableBytes);
            int copied;

            int tailLen = WindowSize - windowEnd;
            if (length > tailLen) {
                copied = input.CopyBytes(window, windowEnd, tailLen);
                if (copied == tailLen) {
                    copied += input.CopyBytes(window, 0, length - tailLen);
                }
            } else {
                copied = input.CopyBytes(window, windowEnd, length);
            }

            windowEnd = (windowEnd + copied) & WindowMask;
            windowFilled += copied;
            return copied;
        }