public byte[] Copy(int offset, int size) { IntPtr mem = Marshal.AllocHGlobal (size); gst_adapter_copy(Handle, out mem, offset, size); byte[] bytes = new byte[size]; Marshal.Copy (mem, bytes, 0, size); return bytes; }