Esempio n. 1
0
        /// <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());
        }
Esempio n. 2
0
            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);
            }