public static int bytesToInt(byte[] ary) {
        return (ary[3] & 0xFF)
            | ((ary[2] << 8) & 0xFF00)
            | ((ary[1] << 16) & 0xFF0000)
            | ((ary[0] << 24) & 0xFF000000);
    }
@Test
    public void bytesToInt() {

        int i = CodecUtils.bytesToInt(new byte[] { 0, 0, 0, 0 });
        Assert.assertEquals(0, i);

        i = CodecUtils.bytesToInt(new byte[] { 0, 0, 3, -24 });
        Assert.assertEquals(1000, i);

        int s = CodecUtils.bytesToInt(new byte[] { 1, 0, 0, 2 });
        Assert.assertEquals(s, 16777218);
    }