473,396 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Does the XMLDocument.Load(System.IO.Stream) method load the whole

The description of the XMLDocument.Load method doesn't quite answer the
question. When passing in a FileStream object to the Load method, does it
load the entire document into memory? For example, if I have a 1 gigabyte
file, would the Load method attempt read the entire 1 gigabyte file into
memory when using a FileStream object?
Sep 12 '08 #1
1 3057
Shawn Sesna wrote:
The description of the XMLDocument.Load method doesn't quite answer the
question. When passing in a FileStream object to the Load method, does it
load the entire document into memory?
Yes. The kind of stream doesn't matter, actually, it will pull data from the
stream until it's read a complete document.
For example, if I have a 1 gigabyte file, would the Load method attempt
read the entire 1 gigabyte file into memory when using a FileStream
object?
It wouldn't actually read all of the file into memory, it would read it
piecewise and construct an in-memory representation of the XML document it
represents while it's doing so. This will end up quite a bit larger than 1
GB, actually. This is why XmlDocument is unsuitable for very large streams.
XmlReader and XPathNavigator are light-weight alternatives.

--
J.
Sep 12 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Manfred Braun | last post by:
Hi All, I am trying to access xml-files in the internet from my intranet-page. Making XmlDocument.Load() calls internally works fine, but not so to the internet. I think the calls are failing,...
13
by: Matthew Wieder | last post by:
In my C# application, I have class which has method that opens an XML document, modifies it and saves it out. I run that method for several different XML documents. What I've found is that the...
3
by: Uldis V. | last post by:
I get an unhandled exception, when I try to execute XmlDocument.Load(...) in my C# Windows application: -------------------------------------------- "Common Language Runtime Debugging Services"...
3
by: ek03 | last post by:
I have a web application that saves/loads XML documents. On occasion, an error is logged on the call to XmlDocument.Load: "process cannot access the file <filepath here> because it is being used by...
0
by: Daniel | last post by:
Does system.xml have any way to transofrm data with an xswl style sheet using strings like MSXML2 does? how to convert this to use System.XML so i do not depend on MSXML2 interop? static...
10
by: lamxing | last post by:
Dear all, I've spent a long time to try to get the xmldocument.load method to handle UTF-8 characters, but no luck. Every time it loads a document contains european characters (such as the...
1
by: Daniel | last post by:
what encoding does system.xml.xmldocument.save(string path) use to save the xml document if there is no <?xml... in the front of the xml document?
3
chunk1978
by: chunk1978 | last post by:
hi there... i'm having a new strange problem with my flash site... IE7 seems to not display my preloader but instead loads the movie with a white screen... the movie does load though... this is a...
5
by: Mahmoud Al-Qudsi | last post by:
Is there any way to stop an XmlDocument object from using data grabbed from a previous request? e.g. if I used XmlDocument.Load to grab a URI, and I know that this URI changes often (for...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.