public static byte[] short2bytes(short num) {
        byte[] result = new byte[2];
        result[0] = (byte) (num >>> 8); //取次低8位放到0下标
        result[1] = (byte) (num); //取最低8位放到1下标
        return result;
    }
@Test
    public void short2bytes() {
        short i = 0;
        byte[] bs = CodecUtils.short2bytes(i);
        Assert.assertArrayEquals(bs, new byte[] { 0, 0 });

        i = 1000;
        bs = CodecUtils.short2bytes(i);
        Assert.assertArrayEquals(bs, new byte[] { 3, -24 });

        short s = 258; // =1*256+2
        bs = CodecUtils.short2bytes(s);
        Assert.assertEquals(bs[0], 1);
        Assert.assertEquals(bs[1], 2);
    }