Namespace: DeltaEngine.Core
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Tests.Core.BinaryDataExtensionsTests
1 unit tests call DeltaEngine.Core.BinaryDataExtensions.ToByteArray(System.Object)
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Parameters
- data
- Type: System Object
Return Value
Type: ByteRemarks
Examples
[Test] public void ExpectExceptionForUnreadableData() { var message = new TestMessage { content = "This message cannot be resolved!", ID = 0 }; var memoryStream = new MemoryStream(new byte[64]); var binaryWriter = new BinaryWriter(memoryStream); binaryWriter.Write(BinaryDataExtensions.ToByteArray(message)); memoryStream.Position = 0; var binaryReader = new BinaryReader(memoryStream); Assert.Throws<TypeLoadException>(() => binaryReader.Create()); }
See Also