public static byte[] intToBytes(int num) {
        byte[] result = new byte[4];
        result[0] = (byte) (num >>> 24);//取最高8位放到0下标
        result[1] = (byte) (num >>> 16);//取次高8为放到1下标
        result[2] = (byte) (num >>> 8); //取次低8位放到2下标
        result[3] = (byte) (num); //取最低8位放到3下标
        return result;
    }
@Test
    public void intToBytes() {
        int i = 1000;
        byte[] bs = CodecUtils.intToBytes(i);
        Assert.assertArrayEquals(bs, new byte[] { 0, 0, 3, -24 });

        i = 0;
        bs = CodecUtils.intToBytes(i);
        Assert.assertArrayEquals(bs, new byte[] { 0, 0, 0, 0 });

        int s = 16777218; // =1*256*256*256+ 0*256*256 +  0*256 + 2
        bs = CodecUtils.intToBytes(s);
        Assert.assertEquals(bs[0], 1);
        Assert.assertEquals(bs[1], 0);
        Assert.assertEquals(bs[2], 0);
        Assert.assertEquals(bs[3], 2);
    }