I want to include a large look-up table (100,000 of 3-byte values) inside a C# module.

Is there a compiler directive that will load binary data from an external file into a static string ?

share|improve this question

3  
Why not use an embedded resource? – Lucero Oct 6 '10 at 18:30
I will do that. Thanks. – Martin Oct 6 '10 at 18:49
feedback

1 Answer

up vote 5 down vote accepted

Why not just include the file into the assembly as an embedded resource, and then load it using Assembly.GetManifestResourceStream? Then just load it from the stream into whatever in-memory data structure you want.

share|improve this answer
This looks like it will do the trick. Thanks. – Martin Oct 6 '10 at 18:49
feedback

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.