in TPM Parser/Tpm2Lib/Globs.cs [212:249]
public static object NetToHostValue(Type t, byte[] data)
{
if (t == typeof(byte))
{
return data[0];
}
if (t == typeof(ushort))
{
return NetToHost2U(data);
}
if (t == typeof(uint))
{
return NetToHost4U(data);
}
if (t == typeof(ulong))
{
return NetToHost8U(data);
}
if (t == typeof(short))
{
return NetToHost2(data);
}
if (t == typeof(int))
{
return NetToHost4(data);
}
if (t == typeof(long))
{
return NetToHost8(data);
}
if (t == typeof(sbyte))
{
return (sbyte)data[0];
}
// Unsupported type
Globs.Throw<ArgumentException>("Globs.NetToHostValue(): Unsupported type " + t);
return 0;
}