System.Net.WebSockets.ManagedWebSocket.ApplyMask C# (CSharp) Method

ApplyMask() private static method

Applies a mask to a portion of a byte array.
private static ApplyMask ( byte toMask, int toMaskOffset, byte mask, int maskOffset, int maskOffsetIndex, long count ) : int
toMask byte The buffer to which the mask should be applied.
toMaskOffset int The offset into at which the mask should start to be applied.
mask byte The array containing the mask to apply.
maskOffset int The offset into of the mask to apply of length .
maskOffsetIndex int The next position offset from of which by to apply next from the mask.
count long The number of bytes starting from to which the mask should be applied.
return int
        private static int ApplyMask(byte[] toMask, int toMaskOffset, byte[] mask, int maskOffset, int maskOffsetIndex, long count)
        {
            Debug.Assert(maskOffsetIndex < MaskLength, $"Unexpected {nameof(maskOffsetIndex)}: {maskOffsetIndex}");
            Debug.Assert(mask.Length >= MaskLength + maskOffset, $"Unexpected inputs: {mask.Length}, {maskOffset}");
            return ApplyMask(toMask, toMaskOffset, CombineMaskBytes(mask, maskOffset), maskOffsetIndex, count);
        }

Same methods

ManagedWebSocket::ApplyMask ( byte toMask, int toMaskOffset, int mask, int maskIndex, long count ) : int