private static object TypeToIntegerObject(CBORObject objThis, Type t)
{
if (t.Equals(typeof(int)))
{
return(objThis.AsInt32());
}
if (t.Equals(typeof(short)))
{
return(objThis.AsInt16());
}
if (t.Equals(typeof(ushort)))
{
return(objThis.AsUInt16());
}
if (t.Equals(typeof(byte)))
{
return(objThis.AsByte());
}
if (t.Equals(typeof(sbyte)))
{
return(objThis.AsSByte());
}
if (t.Equals(typeof(long)))
{
return(objThis.AsInt64());
}
if (t.Equals(typeof(uint)))
{
return(objThis.AsUInt32());
}
if (t.Equals(typeof(ulong)))
{
return(objThis.AsUInt64());
}
throw new CBORException("Type not supported");
}