I need to process a binary resource (contents of a binary file). File contains shorts. I cannot figure out how to pass the result of accessing this resource into a short array:
short[] indexTable = Properties.Resources.IndexTable;
does not work; I can only use
byte[] indexTable = Properties.Resources.IndexTable;
Usage Array.Copywill not work, since it converts every byte from the array returned by accessing the resource to a short one.
How to solve this problem (except for manual byte array conversion)? Is there a way to tell C # that the resource is of type short[]and not byte[]?
I even tried to edit the project resx file and change the resource data types to System.UInt16, but then I got an error message that can now be found for them.
Using VS 2010 Express and .NET 4.0.