0
Ich habe folgende Verfahren in C#:Wie benutzt man die C# Generics in Delphi 2009/2010?
public T Read<T>()
{
T[] t = new T[1];
int s = Marshal.SizeOf(typeof(T));
if (index + s > size)
throw new Exception("Error 101 Celebrity");
GCHandle handle = GCHandle.Alloc(t, GCHandleType.Pinned);
Marshal.Copy(dataRead, index, handle.AddrOfPinnedObject(), s);
index += s;
return t[0];
}
DATA_READ ein Array byte [] ist. Index und Größe sind Integer-Typ.
Die Funktion liest einen Typ aus dataRead (byte []) und erhöht den Index (index + = type).
Im ganzen Netz, wenn ich google "Delphi Generics" - alles, was es erscheint, ist Trecords und Klassen, die nicht das ist, was ich brauche.
Wie mache ich diesen Code in Delphi?