private static bool ValidateUrlEncodingParameters(byte[] bytes, int offset, int count)
{
if (bytes == null && count == 0)
return false;
if (bytes == null)
{
throw new ArgumentNullException(nameof(bytes));
}
if (offset < 0 || offset > bytes.Length)
{
throw new ArgumentOutOfRangeException(nameof(offset));
}
if (count < 0 || offset + count > bytes.Length)
{
throw new ArgumentOutOfRangeException(nameof(count));
}
return true;
}