@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);
}