I have a csv file with binary data inline with text (ie Text,0xFF00). I need to read in both values and save them into a database. Currently I'm using a StreamReader to read in the line and splitting it by the comma. The issue I'm having is I need to convert the binary data into it's byte[] equivalent (ie 0xFF00 goes to {255,0}). Any kind of conversion with encoding will change the binary.
byte[] data= System.Text.Encoding.ASCII.GetBytes(SplitString[1]);
If the entire file was binary I could use File.ReadAllBytes(file)
Is there a way to do this in memory without writing out the binary portion to a temporary file?