Hi,
I want to do this but can;t figure it out! :-( Can I even do it?
public static T Get4Bytes<T>( byte [] ptr , ref int Index)
{
uint ui = 0;
try
{
ui = ( (uint) ptr[ Index++ ] ) << 24;
ui += ( (uint) ptr[ Index++ ] ) << 16;
ui += ( (uint) ptr[ Index++ ] ) << 8;
ui += (uint) ptr[ Index++ ];
}
catch (Exception e)
{
Debug.WriteLine(e);
}
return (T)ui; <--------Cannot convert type 'uint' to 'T'
}
Thanks,
Mike