public unsafe NativeMemoryStream(IAllocator allocator, int capacity)
 {
     Validate.Begin().IsNotNull <IAllocator>(allocator, "allocator").IsNotNegative(capacity, "capacity").Check();
     this.allocator     = allocator.CreateRef();
     this.bufferRef     = null;
     this.bufferLockRef = null;
     this.buffer        = null;
     this.bufferSize    = 0L;
     this.length        = 0L;
     this.position      = 0L;
     if (capacity > 0)
     {
         this.EnsureCapacity((long)capacity);
     }
 }
Beispiel #2
0
 public static IBufferLock CreateRef(this IBufferLock objectRef) =>
 ((IBufferLock)objectRef.CreateRef(typeof(IBufferLock)));