J'ai une méthode python qui retourne un octet Python array.array ('c').Convertir entre tableau python et .NET Array
Maintenant, je veux copier ce tableau en utilisant System.Runtime.InteropServices.Marshal.Copy. Cette méthode attend cependant un tableau .NET.
import array
from System.Runtime.InteropServices import Marshal
bytes = array.array('c')
bytes.append('a')
bytes.append('b')
bytes.append('c')
Marshal.Copy(bytes, dest, 0, 3)
Existe-t-il un moyen de faire fonctionner cette fonction sans copier les données? Si non, comment puis-je convertir les données dans le tableau Python au tableau .NET?
Merci d'avoir répondu. J'ai déjà trouvé une solution à mon problème de marshaling sur le nouveau groupe IronPython (http://groups.google.com/group/ironpy/t/91a344a5ddb7df39) – MvdD