/** * 与C语言通信(java做Client,c/c++做Server,传送一个结构) * @author kingfish * @version 1.0 */ public class Employee2 { PRivate String name; private int id; private float salary;
/** * 将int转为低字节在前,高字节在后的int */ private static int toLH(int in) { int out = 0; out = (in & 0xff) << 24; out = (in & 0xff00) << 8; out = (in & 0xff0000) >> 8; out = (in & 0xff000000) >> 24; return out; }