Ok, so when I have a method that looks like
getPacket(params object[] inputs)
{
}
Is the inputs array an array of boxed variables or is it simply just an array of the original types (im sending multiple different types tho, eg. short, int, bool)
If they are boxed can you do run-time unboxing to the original type without knowing the original type?
If they aren’t boxed, how can I tell whether it’s an int, short, bool etc. as I want to be able to make a single method that puts together a byte array from a whole stack of different types.
Another question, are the objects in the array in the same order as they were passed in the method invocation?
The objects in the array will be in the same order that they were passed to the method and they will be boxed if the source parameter is a value type.
You can use the
iskeyword to check the underlying type of each object and act accordingly, for example: