ByteBufUtils.writeVarShort(buf, 8388607);
assertArrayEquals("Three byte short written", new byte[] { -1, -1, -1}, buf.array());
assertEquals("Three byte short written", 3, buf.readableBytes());
buf.clear();
buf.writeZero(3);
buf.clear();
buf.writeShort(-1);
buf.writeByte(-1);
val = ByteBufUtils.readVarShort(buf);
assertEquals("Three byte short read correctly", 8388607, val);