/// <summary> /// /// </summary> public static UnmanagedMemoryStream GetDirectStream(this ArraySegment <byte> arraySegment) { var fb = new FixedBuffer(arraySegment.Array, arraySegment.Offset, arraySegment.Count); // NB offet/len are applied to fb return(fb.CreateStream()); }
public SafeFixedBuffer(ref FixedBuffer fixedBuffer) : base(false) { var fixedBuffer1 = fixedBuffer; fixedBuffer1.PinBuffer(); SetHandle(new IntPtr(fixedBuffer1._unpinner.PinnedGCHandle.AddrOfPinnedObject().ToInt64() + fixedBuffer1._offset)); Initialize((uint)fixedBuffer1._length); }