public static byte[] uint_to_bytes(uint num) { byte[] rtn = new byte[4]; rtn[3] = (byte)(num & 0x000000ff); rtn[2] = (byte)((num & 0x0000ff00) >> 8); rtn[1] = (byte)((num & 0x00ff0000) >> 16); rtn[0] = (byte)((num & 0xff000000) >> 24); return rtn; }