Mike Simmons wrote:Note that it's a bit unusual to read an XML file into a byte[] array - if you're going to do any serious parsing of the file, you probably want to take advantage of an XML parser first. But perhaps there's some reason you really need a byte[] array instead. Your call.
Unusual, yes, but parsing XML from a byte array instead of a file can also raise other obscure issues. For example if you have a relative URL in your XML (perhaps in its DTD declaration) then the parser will understand what it's relative to if it's parsing from a file, but not if it's parsing from a byte array.
However we know nothing about what this byte array is actually for. Perhaps it's not even going to be parsed.