Hi All,
I want to read the large XML fiile (500 MB). I am using below code... but I am facing Out of Memory exception...
public static byte[] Compress(XElement xml){
string tempFilePath = Path.GetTempFileName();
using (FileStream stream = File.OpenWrite(tempFilePath))
{
xml.Save(stream);
stream.Flush();
stream.Close();
Byte[] srcFileByte = File.ReadAllBytes(tempFilePath);
return srcFileByte;
}
}
Can you please let me know whats is wrong in above code?
-Ajit