If you are dealing with simple data types, then you can use
BinaryReader
and
StreamWriter
classes.
For example:
using (StreamWriter writer = new StreamWriter(textFileName))
{
using (BinaryReader reader = new BinaryReader(
File.Open(binaryFileName, FileMode.Open)))
{
int myInt = reader.ReadInt32();
writer.WriteLine(myInt);
float myFloat = reader.ReadSingle();
writer.WriteLine(myFloat);
...
}
}
But binary files can contain any kind of data. So it is up to you to read the data properly...