decodeXmlStream method
Decodes a byte stream into a string stream, automatically detecting and stripping byte order marks (BOM) and resolving encoding declarations.
For example:
final text = await File('books.xml').openRead().decodeXmlStream().join();
Implementation
Stream<String> decodeXmlStream({Encoding? defaultEncoding}) =>
cast<List<int>>().transform(
XmlByteStreamDecoder(defaultEncoding: defaultEncoding),
);