System.Net.BufferOffsetSize.BufferOffsetSize C# (CSharp) Method

BufferOffsetSize() private method

private BufferOffsetSize ( byte buffer, int offset, int size, bool copyBuffer )
buffer byte
offset int
size int
copyBuffer bool
        internal BufferOffsetSize(byte[] buffer, int offset, int size, bool copyBuffer) {
            GlobalLog.Assert(buffer != null && buffer.Length >= size + offset, "BufferOffsetSize::.ctor|Illegal parameters.");
            if (copyBuffer) {
                byte[] newBuffer = new byte[size];

                System.Buffer.BlockCopy(
                    buffer,     // src
                    offset,     // src index
                    newBuffer,  // dest
                    0,          // dest index
                    size );     // total size to copy

                offset = 0;
                buffer = newBuffer;
            }
            Buffer = buffer;
            Offset = offset;
            Size = size;
            GlobalLog.Print("BufferOffsetSize#" + ValidationHelper.HashString(this) + "::.ctor() copyBuffer:" + copyBuffer.ToString() + " this:[" + ToString() + "]");
        }

Same methods

BufferOffsetSize::BufferOffsetSize ( byte buffer, bool copyBuffer )
BufferOffsetSize