https://github.com/alex-rachel/bsonutility
BsonUtility for Unity
https://github.com/alex-rachel/bsonutility
Last synced: about 1 year ago
JSON representation
BsonUtility for Unity
- Host: GitHub
- URL: https://github.com/alex-rachel/bsonutility
- Owner: Alex-Rachel
- License: mit
- Created: 2025-02-14T06:58:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-14T07:20:35.000Z (over 1 year ago)
- Last Synced: 2025-02-14T08:22:20.079Z (over 1 year ago)
- Language: C#
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BsonUtility
[](https://github.com/Alex-Rachel/BsonUtility/blob/main/LICENSE)
[](https://github.com/Alex-Rachel/BsonUtility)
[](https://github.com/Alex-Rachel/BsonUtility/issues)
[](https://github.com/Alex-Rachel/BsonUtility)
BsonUtility for Unity
A fast BSON library for Unity, compliant to the whole BSON specification test suite. The library parses the binary data on-demand, delaying copies until the last second.
BSON is parsed and generated as specified for version 1.1 of the [BSON specification](http://bsonspec.org/spec.html).
## Basic Usage
Create Documents using Dictionary Literals:
```csharp
public class BsonTest
{
class MyClass
{
public bool b = true;
public int i = 100;
public string s = "Hello World";
public List a = new List();
public class A
{
public int a = 100;
public string b = "Hello World";
}
}
private void Test()
{
MyClass myClass = new MyClass();
// To Bytes
var bytes = Bson.ToBson(myClass);
// To Objects
var myClass2 = Bson.ToObject(bytes);
}
}
```