Click here to Skip to main content
15,879,348 members
Articles / Programming Languages / C#

fastBinaryJSON

Rate me:
Please Sign up or sign in to vote.
4.79/5 (80 votes)
26 Oct 2019CPOL12 min read 358.4K   5.9K   208  
A binary JSON serializer based on fastJSON (support for MonoDroid, netcore)
v1.0
----
- initial release

v1.1
----
- bug fix datetime to local time
- added BJSONParameters 
- added global types (reverse format from fastJSON to overcome size limits on name strings)

v1.2
----
- refactored reflection code into Reflection class
- added support for top level struct object serialize/deserialize

v1.3
----
- bug fix reflection code 
- added unit tests 
- changed ArrayList to List<object>
- updated code to be similar to fastJSON 
- deserialize ToObject< Dictionary<T,V> >  
- deserialize ToObject< List<T> >
- added FillObject method

v1.3.1
------
- bug fix $types and arrays
- optimize writting $types

v1.3.2
------
- null object serialize fixed
- added sealed keyword to classes
- bug fix SerializeNullValues=false and an extra comma at the end
- FillObject nested types

v1.3.3
------
- bug fix deserialize zero length arrays
- test for German locale numbers

v1.3.4
------
- singleton uses ThreadStatic for concurrency (thanks to Philip Jander) 
- bug fix extra comma in the output when only 1 property in the object (thanks to Philip Jander) 

v1.3.5
------
- added support for root level DataSet and DataTable deserialize (you have to do ToObject<DataSet>(...) )
- added dataset tests
- added MonoDroid project

v1.3.6
-------
- bug fix comma and nulls
- UTC parameter for controlling dates
- unified reflection code with Silverlight4
- locks in SafeDictionary

v1.3.7
------
- customtype is now builtin
- added UseUTCTimes property for datetime 
- switched to properttype enum instead of booleans
- using switch instead of linked if statements
- unified DynamicMethod between silverlight and full .net
- SafeDictionary lock fixes

v1.3.8
------
- added serialization of static fields and properties
- fixed disabling extensions in the output
- fixed serializing anonymous types
- added support for dynamic objects

v1.3.9
------
- fix dynamic objects and lists
- fix deserialize Dictionary<T, List<V>> and Dictionary<T, V[]>
- added tests for dictionary with lists

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect -
United Kingdom United Kingdom
Mehdi first started programming when he was 8 on BBC+128k machine in 6512 processor language, after various hardware and software changes he eventually came across .net and c# which he has been using since v1.0.
He is formally educated as a system analyst Industrial engineer, but his programming passion continues.

* Mehdi is the 5th person to get 6 out of 7 Platinum's on Code-Project (13th Jan'12)
* Mehdi is the 3rd person to get 7 out of 7 Platinum's on Code-Project (26th Aug'16)

Comments and Discussions