bytearray - Convert object to byte array in c# -
i want convert object value byte array in c#.
ex:
step 1. input : 2200 step 2. after converting byte : 0898 step 3. take first byte(08) output: 08
thanks
you may take @ getbytes method:
int = 2200; byte[] bytes = bitconverter.getbytes(i); console.writeline(bytes[0].tostring("x")); console.writeline(bytes[1].tostring("x"));
also make sure have taken endianness consideration in definition of first byte.
Comments
Post a Comment