How do I split a short into its two bytes ?

Posted by aPoC on Stack Overflow See other posts from Stack Overflow or by aPoC
Published on 2010-06-05T10:13:34Z Indexed on 2010/06/05 10:22 UTC
Read the original article Hit count: 230

Filed under:

Hi. I have to split up a short into its two bytes. They have to be in Network order.
I need that for a small server telling the current size of the rest packet's data.

List<byte> o = new List<byte>();
o.Add(0x03);
// here this short
o.AddRange(MapData);
o.Add(0xFF);
Send(o);

© Stack Overflow or respective owner

Related posts about c#