I need some help with the following line in perl:
pack "NN", $b, $a;
I can’t really understand how to convert that to C#. where a & b are both int
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In .NET the result would not be a string, but a byte array. A string is composed of 16-bit
charvalues, so that is not convenient for representing 8-bit data.Use a method like this to get the “network” representation of an integer:
Write the byte arrays to a memory stream:
Now you have an array with eight bytes; each integer in big endian format.