I'm sure this is an easy question, but I don't have an answer for. Here's the senario and the question.
I have an array that was stored using in a particular format. The format contains a Header record with muntiple detail records following it. The header of the record tells me what TypeCode was used to store the data, for instance Int32.
I have a routine that takes a byte[] array and converts the byte data back to it's proper format in C#. This routine needs the proper number of bytes to make the conversion successful.
Q. So how can I get the length of bytes from the given TypeCode for passing to the Convert function without having to hardcode the length for every type?