C# int to byte[]
- by Petoj
If I need to convert an int to byte[] I could use Bitconvert.GetBytes().
But if I should follow this:
An XDR signed integer is a 32-bit datum that encodes an integer in
the range [-2147483648,2147483647]. The integer is represented in
two's complement notation. The most and least significant bytes are
0 and 3, respectively. Integers are declared as follows:
Taken from RFC1014 3.2.
What method should I use then if there is no method to do this? How would it look like if you write your own?
I don't understand the text 100% so I can't implement it on my own.