TryDetectXmlEncoding Method
Definition
- Namespace
- Cuemon.Extensions.Xml
- Assemblies
- Cuemon.Extensions.Xml.dll
TryDetectXmlEncoding(Stream, out Encoding)
public static bool TryDetectXmlEncoding(this Stream value, out Encoding result)
Parameters
valueStreamThe XML Stream to extend.
resultEncodingWhen this method returns, it contains the Encoding value equivalent to the encoding level of the XML document contained in
value, if the conversion succeeded, or a null reference (Nothing in Visual Basic) if the conversion failed. The conversion fails if thevalueparameter is null, does not contain BOM information or does not contain an XmlDeclaration.
Returns
- bool
trueif thevalueparameter was converted successfully; otherwise,false.
Exceptions
- ArgumentNullException
valuecannot be null.