created a binary file by using c#: The code I used was this
try
{
Console.WriteLine("Binary Writer");
using (BinaryWriter b = new BinaryWriter(File.Open("C:\\file.bin",FileMode.Create)))
{
b.Write("world");
b.Write("god");
b.Write("its cool");
b.Write("1000");
b.Flush();
}
}
catch (IOException ioexp)
{
Console.WriteLine("Error: {0}", ioexp.Message);
}
}
The output file what i see had-
world(SOMETHING HERE)god(SOMETHING HERE)its cool(SOMETHING HERE)1000
Isn'nt it should be something in binary format?
Actually the file is in binary format. Every file is in binary format, the difference between text files and data files is that on text files, each byte will map directly to it's char representation. What are you seeing here instead, is that for each piece of information that you wrote in that file, there is something else that is used to encode that information.