I have this text file what contains different fields. Some fields may contain binary data. I need to get all the data in the file but right now when using StreamReader then it wont read the binary data block and data what comes after that. What would be the best solution to solve this problem?
Example:
field1|field2|some binary data here|field3
Right now i read in the file like this:
public static string _fileToBuffer(string Filename)
{
if (!File.Exists(Filename)) throw new ArgumentNullException(Filename, "Template file does not exist");
StreamReader reader = new StreamReader(Filename, Encoding.Default, true);
string fileBuffer = reader.ReadToEnd();
reader.Close();
return fileBuffer;
}
EDIT: I know the start and end positions of the binary fields.
use BinaryReader