4 using System.Runtime.InteropServices;
5 using SiliconStudio.Core;
6 using SiliconStudio.Core.IO;
8 namespace SiliconStudio.Core.Storage
16 private readonly IntPtr content;
17 private readonly
int size;
22 this.objectDatabase = objectDatabase;
23 this.objectId = objectId;
27 : this(objectDatabase, objectId)
30 this.content = Marshal.AllocHGlobal(
size);
31 Utilities.CopyMemory(this.content, content,
size);
34 internal Blob(ObjectDatabase objectDatabase, ObjectId objectId,
NativeStream stream)
35 : this(objectDatabase, objectId)
37 this.size = (int)stream.Length;
38 this.content = Marshal.AllocHGlobal(
this.size);
61 get {
return content; }
72 get {
return objectId; }
77 get {
return objectDatabase; }
93 objectDatabase.DestroyBlob(
this);
94 Marshal.FreeHGlobal(this.content);
Stores immutable binary content.
Blob(ObjectDatabase objectDatabase, ObjectId objectId)
A read-only NativeMemoryStream that will properly keep references on its underlying Blob...
override void Destroy()
Releases unmanaged and - optionally - managed resources
Gives access to the object database.
Base class for a IReferencable class.
NativeStream GetContentStream()
Gets a NativeStream over the Content.
A hash to uniquely identify data.
A Stream with additional methods for native read and write operations using IntPtr.
Only valid for a property / field that has a class or struct type. When restored, instead of recreati...
_In_ size_t _In_ size_t size