Skip to content

Instantly share code, notes, and snippets.

@joliver
Created January 18, 2011 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joliver/784370 to your computer and use it in GitHub Desktop.
Save joliver/784370 to your computer and use it in GitHub Desktop.
Bug in Json.NET 4.0r1?
public void Test()
{
var serializer = new Newtonsoft.Json.JsonSerializer();
using (var memoryStream = new MemoryStream())
{
using (var bsonWriter = new BsonWriter(memoryStream))
serializer.Serialize(bsonWriter, 12345);
Console.Write("Stream length is: " + memoryStream.Length); // shouldn't be *0*!
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment