What is the max. size limt of XmlTextWriter?

  • Thread starter Thread starter Terrence Chan
  • Start date Start date
T

Terrence Chan

Does anyone know the size limit of the StringWriter and XmlTextWriter.

Dim buffer As New System.IO.StringWriter
Dim writer As New System.Xml.XmlTextWriter(buffer)

Please point me to some technical documents.

Thanks,
Terrence
 
Terrence,
The size limit of a XmlTextWriter is the size of the underlying Stream (or
StreamWriter), the max size would be Int64.MaxValue (Long.MaxValue)

http://msdn.microsoft.com/library/d...rlrfSystemXmlXmlTextWriterClassctorTopic2.asp

Length of a stream = Stream.Length
http://msdn.microsoft.com/library/d.../html/frlrfSystemIOStreamClassLengthTopic.asp


Now if you are really asking about the size limit of a StringWriter, then it
would be Int32.MaxValue (Integer.MaxValue) the capacity of the underlying
StringBuilder.

http://msdn.microsoft.com/library/d.../html/frlrfSystemIOStringWriterClassTopic.asp

http://msdn.microsoft.com/library/d...temTextStringBuilderClassMaxCapacityTopic.asp

Of course with both methods (Stream & StringWriter) you will more then
likely run out of system resources first, either actual harddisk space or
virtual memory.

Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top