A
Anatoli Koutsevol
Is there some way to determine size in bytes
for a type parameter T in generic class cls<T>.
For instance, I need some generic way to covert
T [] array to an array of bytes and conversely,
as in BitConverter.GetBytes.
To create a buffer I'd like to have something like this
T [] srcData;
byte [] buffer = new byte[srcData.Length*sizeof(T)];
But it cannot be compiled in this syntax.
Any suggestions?
Thanks.
for a type parameter T in generic class cls<T>.
For instance, I need some generic way to covert
T [] array to an array of bytes and conversely,
as in BitConverter.GetBytes.
To create a buffer I'd like to have something like this
T [] srcData;
byte [] buffer = new byte[srcData.Length*sizeof(T)];
But it cannot be compiled in this syntax.
Any suggestions?
Thanks.