Ejemplo n.º 1
0
        public static CMBlockBuffer FromMemoryBlock(byte [] data, nuint offsetToData, CMBlockBufferFlags flags, out CMBlockBufferError error)
        {
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }

            var allocator = new CMManagedArrayBlockAllocator(data);

            return(FromMemoryBlock(IntPtr.Zero, (uint)data.Length, allocator, offsetToData, (uint)data.Length, flags, out error));
        }
Ejemplo n.º 2
0
        public CMBlockBufferError AppendMemoryBlock(byte [] data, nuint offsetToData, CMBlockBufferFlags flags)
        {
            if (Handle == IntPtr.Zero)
            {
                throw new ObjectDisposedException("BlockBuffer");
            }
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }

            var allocator = new CMManagedArrayBlockAllocator(data);

            return(AppendMemoryBlock(IntPtr.Zero, (uint)data.Length, allocator, offsetToData, (uint)data.Length, flags));
        }
Ejemplo n.º 3
0
        public CMBlockBufferError AppendMemoryBlock(byte [] data, nuint offsetToData, CMBlockBufferFlags flags)
        {
            if (Handle == IntPtr.Zero)
                throw new ObjectDisposedException ("BlockBuffer");
            if (data == null)
                throw new ArgumentNullException (nameof (data));

            var allocator = new CMManagedArrayBlockAllocator (data);
            return AppendMemoryBlock (IntPtr.Zero, (uint) data.Length, allocator, offsetToData, (uint) data.Length, flags);
        }
Ejemplo n.º 4
0
        public static CMBlockBuffer FromMemoryBlock(byte [] data, nuint offsetToData, CMBlockBufferFlags flags, out CMBlockBufferError error)
        {
            if (data == null)
                throw new ArgumentNullException (nameof (data));

            var allocator = new CMManagedArrayBlockAllocator (data);
            return FromMemoryBlock (IntPtr.Zero, (uint) data.Length, allocator, offsetToData, (uint) data.Length, flags, out error);
        }