binary data...

FlyBoy

Well-known member
Joined
Sep 6, 2004
Messages
106
im reading a book ... and now im in the phase of binary data..converting from string\and\or any other data types to binary and vice versa, using bitconverter ,memorystream,binarywriter,binaryreader.
my question is...what the use of converting data to binary????
why do i need this??? (except from encoding files and such...)

10x in advance.
 
Converting a string to binary is useless as it will appear in the file exactly how you wrote it.
However, if you were to store numbers in the file, only the binary data will be stored instead of the string representation of the number.

For instance, if you wanted to store the number 2147483467 to a file, youd have a 10 byte large file if you saved it with the StreamWriter.
If you saved it with the StreamReader, youd have garbage looking characters like this:
 
Back
Top