コード例 #1
0
        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));
            }
        }
コード例 #2
0
ファイル: HTTPPackage.cs プロジェクト: SuperKrait/NetFormwork
 public void AddBuffer(byte[] data, long length)
 {
     bufferCount += length;
     now          = now.AddBuffer(data, 0, length);
 }