Ejemplo n.º 1
0
        public CFDataBuffer(byte[] buffer)
        {
            this.buffer = buffer;
            this.handle = GCHandle.Alloc (this.buffer, GCHandleType.Pinned);

            data = CFData.FromDataNoCopy (handle.AddrOfPinnedObject (), buffer.Length);
            owns = true;
        }
Ejemplo n.º 2
0
 protected virtual void Dispose(bool disposing)
 {
     if (data != null)
     {
         data.Dispose();
         data = null;
     }
 }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
		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;
		}
Ejemplo n.º 5
0
		internal void SetBody (CFData data)
		{
			CFHTTPMessageSetBody (Handle, data.Handle);
		}
Ejemplo n.º 6
0
 public CFDataBuffer(IntPtr ptr)
 {
     data = new CFData (ptr, false);
     buffer = data.GetBuffer ();
     owns = false;
 }
Ejemplo n.º 7
0
 protected virtual void Dispose(bool disposing)
 {
     if (data != null) {
         data.Dispose ();
         if (owns)
             handle.Free ();
         data = null;
     }
 }
Ejemplo n.º 8
0
		internal void SetBody (CFData data)
		{
			ThrowIfDisposed ();
			CFHTTPMessageSetBody (Handle, data.Handle);
		}
Ejemplo n.º 9
0
 public CFDataBuffer(IntPtr ptr)
 {
     data   = new CFData(ptr, false);
     buffer = data.GetBuffer();
 }
Ejemplo n.º 10
0
		protected virtual void Dispose (bool disposing)
		{
			if (data != null) {
				data.Dispose ();
				data = null;
			}
		}