"Govind" <go******@interworldgroup.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi All ,
I have converted a Integer to Byte and Written in to the file.
After that i read the file byte by byte then I want to Convert th Bytes to
Integer . If any method is available to convert Bytes to Integer pls Let me Know.
Hello,
Byte to integer conversion can be implicit. In other words, you don't need
to write special code.
byte b = Convert.ToByte("5", 10);
//Change it to an integer.
int i = b;
Console.WriteLine(i); // prints 5
You can look at the convert class, which is what I used to put the string
"5" into a byte, but you don't need it to convert a byte to an integer.
But maybe that's not what you need. Maybe you should look up serialization
in the help files. You don't have to convert stuff byte by byte yourself to
write it to a binary file.
HTH
Eric