internal byte[] ReadContentAsBase64(string str)
{
if (str == null)
return null;
str = str.Trim();
if (str.Length == 0)
return Array.Empty<byte>();
try
{
return Convert.FromBase64String(str);
}
catch (ArgumentException exception)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlExceptionHelper.CreateConversionException(str, "byte[]", exception));
}
catch (FormatException exception)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlExceptionHelper.CreateConversionException(str, "byte[]", exception));
}
}