public CFDataBuffer(byte[] buffer) { this.buffer = buffer; this.handle = GCHandle.Alloc (this.buffer, GCHandleType.Pinned); data = CFData.FromDataNoCopy (handle.AddrOfPinnedObject (), buffer.Length); owns = true; }
protected virtual void Dispose(bool disposing) { if (data != null) { data.Dispose(); data = null; } }
public CFDataBuffer(byte[] buffer) { this.buffer = buffer; /* * Copy the buffer to allow the native side to take ownership. */ var gch = GCHandle.Alloc(buffer, GCHandleType.Pinned); data = CFData.FromData(gch.AddrOfPinnedObject(), buffer.Length); gch.Free(); }
public CFDataBuffer (byte[] buffer) { this.buffer = buffer; /* * Copy the buffer to allow the native side to take ownership. */ var gch = GCHandle.Alloc (buffer, GCHandleType.Pinned); data = CFData.FromData (gch.AddrOfPinnedObject (), buffer.Length); gch.Free (); owns = true; }
internal void SetBody (CFData data) { CFHTTPMessageSetBody (Handle, data.Handle); }
public CFDataBuffer(IntPtr ptr) { data = new CFData (ptr, false); buffer = data.GetBuffer (); owns = false; }
protected virtual void Dispose(bool disposing) { if (data != null) { data.Dispose (); if (owns) handle.Free (); data = null; } }
internal void SetBody (CFData data) { ThrowIfDisposed (); CFHTTPMessageSetBody (Handle, data.Handle); }
public CFDataBuffer(IntPtr ptr) { data = new CFData(ptr, false); buffer = data.GetBuffer(); }
protected virtual void Dispose (bool disposing) { if (data != null) { data.Dispose (); data = null; } }