BinaryDataExtensions ClassDelta Engine Documentation
Allows to easily save and recreate binary data objects with the full type names like other Serializers, but way faster (100x). Before reconstructing types load all needed assemblies. View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Core BinaryDataExtensions

Namespace: DeltaEngine.Core
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public static class BinaryDataExtensions

The BinaryDataExtensions type exposes the following members.

Methods

  NameDescription
Public methodStatic memberCreate
Loads a binary data object and reconstructs the object based on the saved type information. View code on GitHub
Public methodStatic memberCreateFromMemoryStream
Public methodStatic memberGetTypeFromShortNameOrFullNameIfNotFound
Public methodStatic memberLoadDataWithKnownTypeFromMemoryStream DataType 
Public methodStatic memberLoadKnownTypeWithoutVersionCheck DataType 
Public methodStatic memberSave
Saves any object type information and the actual data contained in in, use Create to load. View code on GitHub
Public methodStatic memberSaveDataIntoMemoryStream DataType 
Public methodStatic memberSaveToMemoryStream
Public methodStatic memberToBinaryData
Public methodStatic memberToByteArray
Public methodStatic memberToByteArrayWithLengthHeader
Public methodStatic memberToByteArrayWithTypeInformation
Top
Remarks

Tests: DeltaEngine.Tests.Core.BinaryDataExtensionsTests
Examples

7 unit tests call DeltaEngine.Core.BinaryDataExtensions
[Test]
public void DynamicallyCreatedTypeIsNotStored()
{
    var unknownObject = new ExpandoObject();
    Assert.Throws<BinaryDataExtensions.NoShortNameStoredFor>(
        () => BinaryDataExtensions.GetShortName(unknownObject));
}
[Test]
public void BuiltInTypeGetShortName()
{
    const int Value = 0;
    Assert.AreEqual("Int32", BinaryDataExtensions.GetShortName(Value));
}
[Test]
public void CannotSaveObjectDataIfNull()
{
    var binaryWriter = new BinaryWriter(new MemoryStream());
    Assert.Throws<ArgumentNullException>(() => BinaryDataExtensions.Save(null, binaryWriter));
}
See Also