System.Net.Security.SecurityBuffer.SecurityBuffer C# (CSharp) Method

SecurityBuffer() public method

public SecurityBuffer ( byte data, int offset, int size, SecurityBufferType tokentype ) : System.Diagnostics
data byte
offset int
size int
tokentype SecurityBufferType
return System.Diagnostics
        public SecurityBuffer(byte[] data, int offset, int size, SecurityBufferType tokentype)
        {
            if (offset < 0 || offset > (data == null ? 0 : data.Length))
            {
                NetEventSource.Fail(this, $"'offset' out of range.  [{offset}]");
            }

            if (size < 0 || size > (data == null ? 0 : data.Length - offset))
            {
                NetEventSource.Fail(this, $"'size' out of range.  [{size}]");
            }

            this.offset = data == null || offset < 0 ? 0 : Math.Min(offset, data.Length);
            this.size = data == null || size < 0 ? 0 : Math.Min(size, data.Length - this.offset);
            this.type = tokentype;
            this.token = size == 0 ? null : data;
        }

Same methods

SecurityBuffer::SecurityBuffer ( ChannelBinding binding ) : System.Diagnostics
SecurityBuffer::SecurityBuffer ( byte data, SecurityBufferType tokentype ) : System.Diagnostics
SecurityBuffer::SecurityBuffer ( int size, SecurityBufferType tokentype ) : System.Diagnostics
SecurityBuffer