New issue 35 by DanielLP...@gmail.com: JsonWriter doesn't flush on
Dispose/Close
http://code.google.com/p/jayrock/issues/detail?id=35
What steps will reproduce the problem?
1. create JsonTextWriter in using block
2. encode a large json object
What is the expected output? What do you see instead?
content not flushed / malformed JSON
What version of the product are you using? On what operating system?
I checked the latest code checked in and I don't see a call to flush.
Comment #1 on issue 35 by azizatif: JsonWriter doesn't flush on
Dispose/Close
http://code.google.com/p/jayrock/issues/detail?id=35
Can you attach a stand-alone sample console that demonstrates this problem?
I can't currently, but I found another instance where this causes a problem
that you might be able to reproduce more easily:
HttpWebRequest request = WebRequest.Create(_uri_) as HttpWebRequest;
request.Method = "POST";
request.Headers.Add(HttpRequestHeader.ContentEncoding, "application/json;
charset=UTF8");
using ( JsonWriter writer = new JsonTextWriter(new StreamWriter(
request.GetRequestStream())))
{
JsonConvert.Export(RegistrationData_, writer);
}
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
This code will hang because the request stream is never closed/flushed