UBinarySerializer 0.0.3-alpha
See the version list below for details.
dotnet add package UBinarySerializer --version 0.0.3-alpha
NuGet\Install-Package UBinarySerializer -Version 0.0.3-alpha
<PackageReference Include="UBinarySerializer" Version="0.0.3-alpha" />
paket add UBinarySerializer --version 0.0.3-alpha
#r "nuget: UBinarySerializer, 0.0.3-alpha"
// Install UBinarySerializer as a Cake Addin #addin nuget:?package=UBinarySerializer&version=0.0.3-alpha&prerelease // Install UBinarySerializer as a Cake Tool #tool nuget:?package=UBinarySerializer&version=0.0.3-alpha&prerelease
UBinarySerializer
Framework for data binary serialization.
Getting started.
To create serializer for specific object type,
you need to create BinarySerializer<>
instance:
BinarySerializer<MyObject> serializer = new BinarySerializer<MyObject>();
Then to serialize object to binary data use Serialize
or SerializeUnsafe
methods.
Difference between them, is that Serialize
method serializes the data safely,
allows to serialize null-reference objects and saves object data version (generation) for backward-compatibility.
SerializeUnsafe
optimized for fast serialization, and disallows null-references.
To control fields and properties during serialization use BinIndexAttribute
:
using System;
using NullSoftware.Serialization;
public class Player
{
[BinIndex(0)]
public int Health { get; set; }
[BinIndex(1, Generation = 2)]
public int Hunger { get; set; }
[BinIndex(2)]
public Vector3 Postion { get; set; }
[BinIndex(3)]
public GameMode GameMode { get; set; }
[BinIndex(4)]
public Texture Skin { get; set; }
[BinIndex(5)]
public List<Item> Items { get; set; }
= new List<Item>();
public int DeathsCount { get; set; } // will not be serialized.
}
Generation
allows to add new fields/properties for already serialized object without breaking serialization (in case if Serialize
method was used).
If there is no BinIndexAttribute
specified in object will be serialized all not-readonly fields/properties.
Also can be used RequiredAttribute
from System.ComponentModel.DataAnnotations
to specify that current field/property can not have null-reference even in 'safe' serialization.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 is compatible. netcoreapp3.1 is compatible. |
.NET Framework | net45 is compatible. net451 is compatible. net452 is compatible. net46 is compatible. net461 is compatible. net462 is compatible. net463 was computed. net47 is compatible. net471 is compatible. net472 is compatible. net48 is compatible. net481 was computed. |
-
.NETCoreApp 3.0
- No dependencies.
-
.NETCoreApp 3.1
- No dependencies.
-
.NETFramework 4.5
- No dependencies.
-
.NETFramework 4.5.1
- No dependencies.
-
.NETFramework 4.5.2
- No dependencies.
-
.NETFramework 4.6
- No dependencies.
-
.NETFramework 4.6.1
- No dependencies.
-
.NETFramework 4.6.2
- No dependencies.
-
.NETFramework 4.7
- No dependencies.
-
.NETFramework 4.7.1
- No dependencies.
-
.NETFramework 4.7.2
- No dependencies.
-
.NETFramework 4.8
- No dependencies.
-
net5.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
0.1.1.7-alpha | 124 | 1/20/2023 | |
0.0.3.2-alpha | 136 | 5/12/2022 | |
0.0.3.1-alpha | 147 | 5/1/2022 | |
0.0.3-alpha | 160 | 5/1/2022 | |
0.0.2.1-alpha | 152 | 5/1/2022 | |
0.0.2-alpha | 151 | 5/1/2022 | |
0.0.1-alpha | 161 | 4/23/2022 |
Fixed bug with custom converters for abstract type.