public HTTPPackageLinkNode AddBuffer(byte[] data, long sourcesIndex, long length)
        {
            long totolLength = index + length;

            if (totolLength <= buffer.Length)
            {
                Array.Copy(data, sourcesIndex, buffer, index, length);
                index += length;
                return(this);
            }
            else
            {
                long tmpLength = buffer.Length - index;
                Array.Copy(data, sourcesIndex, buffer, index, tmpLength);
                index   += tmpLength;
                nextNode = CreateNewNode();
                return(nextNode.AddBuffer(data, sourcesIndex + tmpLength, length - tmpLength));
            }
        }
Example #2
0
 public void AddBuffer(byte[] data, long length)
 {
     bufferCount += length;
     now          = now.AddBuffer(data, 0, length);
 }