Questions tagged [stringwriter]

StringWriter class could refer to java.io.StringWriter (part of the the standard java io library ) or to System.IO.StringWriter (part of .NET framework)

StringWriter class could refer to java.io.StringWriter (part of the the standard java io library ) or to System.IO.StringWriter (part of .NET framework)

76 questions
0
votes
1 answer

Duplication occurring during XML serialization of Class Object

I'm trying to serialize a class object into XML but the result ends up having it doubled. I pass the object into the function only once but duplicates by the time it passes through serialization. When debugging, I noticed that my StringWriter has…
0
votes
0 answers

How to create and Download pdf file in c# using stringbuilder?

I am trying to convert create and download PDF file using String Builder using the following code but on "htmlparser.Parse(sr);" i get an error..Saying as: Input string is not in format. Thanks in advance. using (StringWriter sw = new…
0
votes
1 answer

why groovy each function not iterating while inside another one

why groovy .each function is only one time iterating while it lies inside another one iteration like shown below code ? Code: @Grab('com.xlson.groovycsv:groovycsv:1.1') import static com.xlson.groovycsv.CsvParser.parseCsv import…
0
votes
2 answers

Converting DataTable to string type

I have a function like this public DataTable GetAllPrimaryKeyTables(string localServer, string userName, string password, string selectedDatabase) { // Create the datatable DataTable…
Srivastava
  • 3,500
  • 12
  • 46
  • 74
0
votes
1 answer

What is correct way to use a static StringWriter in a web application?

I have a static StringWriter variable in a web application's Handler class, used by multiple private methods in the class. Each method appends a String to this variable, and finally the StringWriter writes the concatenated String to file. But while…
Ray
  • 3,864
  • 7
  • 24
  • 36
0
votes
0 answers

JaxB2Marshaller throwing Null pointer Exception

So, I have this method which marshals an object. public String marshalResponse(Object messageObject) { if (messageObject == null) { return null; } String finalstring ="No results found!"; try { StringWriter sw = new…
voucher_wolves
  • 565
  • 10
  • 20
0
votes
2 answers

converting datatable to xml giving outofmemory exception

While trying to converting a datatable data to xml through stringwriter. It si giving outof memory exception. My datatable contains about 20000 records. Below is the code I am trying DataTable dt = GetData();// contains 20000 records. …
sandeep.mishra
  • 825
  • 4
  • 19
  • 40
0
votes
1 answer

c# serialization xmlwriter stringwriter out of memory for large objecthelp

I am managing a large project and need to serialize and send an object in xml format. The object is ~130 mb. (NOTE: I did not write this project, so making edits outside of this method, or drastically changing the architecture is not an option. …
jo phul
  • 639
  • 1
  • 9
  • 29
0
votes
2 answers

StringWriter in windows universal app

I am absolutely new to programming. I'm trying to create a very simple app with three TextBoxes and one final TextBlock. I want to save the input from these three TextBoxes locally so I can read and display it in a TextBlock on the bottom of the…
HelpPls4112
  • 11
  • 1
  • 3
0
votes
1 answer

StringWriter memory out of bounds exception

I have a method ExecuteResult, which is throwing a System.OutOfMemoryException at the line Response.Write(sw.ToString()). This is happening because the StringWriter object is too large in memory for the ToString; it fills up the memory. I've been…
mgmedick
  • 686
  • 7
  • 23
0
votes
1 answer

Calling close on passed in member StringWriter to XMLTextWriter

I found some code that was not correctly wrapping XMLTextWriter and StringWriter with the using clauses. As I'm correcting it, I stumbled on a interesting question: do I have to explicitly add calls to Close() on each writer or does XMLTextWriter…
tatmanblue
  • 1,176
  • 2
  • 14
  • 30
0
votes
1 answer

Why does gson use StringWriter in method toJSONString()?

From source code: public String toJson(Object src, Type typeOfSrc) { StringWriter writer = new StringWriter(); this.toJson((JsonElement)this.toJsonTree(src, typeOfSrc), (Appendable)writer); return writer.toString(); } StringWriter uses…
JustFF
  • 115
  • 1
  • 1
  • 6
0
votes
1 answer

How to add new header line asp.net Response.Output.Write?

I have a grid-view and I exported to grid-view data to word as shown below. The grid-view data and style works as I expected. Now I want to and new header line to word document and than send my grid-view data under it. I have to add heading to word…
NTMS
  • 816
  • 7
  • 22
0
votes
1 answer

Velocity Template merge method takes in a StringWriter but buff size not enough

I am trying to read from an excel file that contains more than 5000 rows and more than 10 worksheets using Apache POI , I get all the columns and row values and store it in a ArrayListMultiMap>, this logic works perfectly fine , then I store this…
0
votes
5 answers

How do I return a StringWriter When I can't Clone it?

My code looks like the below. Obviously I can't write 'Ok' because the object has been disposed. I can't do return sw.Clone() because clone doesn't exist. If I don't use a using then at any point between = new and return (like iterating and writing…
user34537