Click here to Skip to main content
15,879,474 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.5K   5.9K   208  
A binary JSON serializer based on fastJSON (support for MonoDroid, netcore)
v1.4.10
-------
- added BJSONParameters.SerializerMaxDepth
- speed optimize (thanks to wmjordan)
- added BJSONSerializer.Dispose() to get rid of compiler warnings

v1.4.9
------
- support for multidimensional arrays (thanks to wmjordan)

v1.4.8
------
- bug fix public static properties

v1.4.7
------
- bug fix byte[] keys with Dictionary (thanks to Stanislav Lukeš)

v1.4.6
------
- bug fix serializing static fields and properties
- skip indexer properties on objects (thanks to scymen)

v1.4.5
------
- code sync reflection.cs with fastJSON v2.1.7

v1.4.4
------
- bug fix deserialize private set and no set properties 
- added ReadonlyTest() test for the above 

v1.4.3
------
- bug fix deserializing a struct property in a class

v1.4.2
------
- bug fix circular references

v1.4.1
------
- bug fix obj.List<List<object>> and obj.List<object[]> 
- added code intellisense help for methods
- added ClearReflectionCache() to reset all internal structures

v1.4.0
------
- *breaking change* : removed the BJSON.Instance singleton 
- moved all the state from BJSON to the Reflection singleton
- all of the BJSON interface is now static  
- added BJSONParameters overloads for ToObject()
- support for circular referenced object structures
- added circular test

v1.3.14.1
---------
- added ParametricConstructorOverride parameter to control non default constructors

v1.3.14
-------
- fixed create enum from value and string
- replaced safedictionary with dictionary for some of the internals so no locks on read
- added custom ignore attributes (Thanks to Jared Thirsk)
- using IsDefined instead of GetCustomAttributes (Thanks to Andrew Rissing)
- moved all the reflection code out of BJSON.cs
- now you can deserialize non default constructor classes (Thanks to Anton Afanasyev)

v1.3.13
-------
- fixed working with const properties and fields (i.e ignored)

v1.3.12
-------
- bug fix dynamic json and root arrays e.g. [1,2,3,4]
- bug fix objects in array dynamic types e.g. [1,2,{"prop":90}]
- added support for special collections : StringDictionary, NameValueCollection

v1.3.11
-------
- added signed assembly 
- version numbers will stay at 1.0.0.0 for drop in compatibility
- file version will reflect the build number
- bug fix deserializing to dictionaries instead of dataset when type is not defined
- access inner property in arrays in dynamic types e.g. d.arr[1].a 

v1.3.10
-------
- fixed hastable deserialize
- added test for hashtable
- changed list of getters to array ~3% performance gain
- removed unused code

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

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.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.6
-------
- bug fix comma and nulls
- UTC parameter for controlling dates
- unified reflection code with Silverlight4
- locks in SafeDictionary

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.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.3
------
- bug fix deserialize zero length arrays
- test for German locale numbers

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.1
------
- bug fix $types and arrays
- optimize writting $types

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.2
----
- refactored reflection code into Reflection class
- added support for top level struct object serialize/deserialize

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.0
----
- initial release

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