I need to process a binary resource (contents of a binary file). The file contains shorts. I can't figure how to cast the result of accessing that resource to a short array though:
short[] indexTable = Properties.Resources.IndexTable;
doesn't work; I can only use
byte[] indexTable = Properties.Resources.IndexTable;
Using Array.Copy
wouldn't work since it would convert each byte from the array returned by accessing the resource to a short.
How do I solve this problem please (other than manually converting the byte array)? Is there a way to tell C# that the resource is of type short[]
rather than byte[]
?
I had even tried to edit the project's resx file and change the resources' data types to System.UInt16, but then I got the error message that now constructor could be found for them.
Using VS 2010 Express and .NET 4.0.