@org.junit.Test
	public void testSerialiseInt()
	{
		for (int size = 1; size <= 8; size++) {
			int[] numvals = new int[]{0, 10, 127, 128, 255};
			for (int idx = 0; idx != numvals.length; idx++) {
				byte[] barr = ByteOps.encodeInt(numvals[idx], size);
				int val = ByteOps.decodeInt(barr, 0, size);
				org.junit.Assert.assertEquals("size="+size+"/idx="+idx, numvals[idx], val);
				org.junit.Assert.assertEquals("size="+size+"/idx="+idx, size, barr.length);
			}
		}

		for (int size = 2; size <= 8; size++) {
			int[] numvals = new int[]{256, 0x0102, 0x8192, 0xffff, 0x7fff, 0x8000};
			for (int idx = 0; idx != numvals.length; idx++) {
				byte[] barr = ByteOps.encodeInt(numvals[idx], size);
				int val = ByteOps.decodeInt(barr, 0, size);
				org.junit.Assert.assertEquals("size="+size+"/idx="+idx, numvals[idx], val);
				org.junit.Assert.assertEquals("size="+size+"/idx="+idx, size, barr.length);
			}
		}

		for (int size = 4; size <= 8; size++) {
			int[] numvals = new int[]{-1, Integer.MAX_VALUE, 0xef028104, 0x12345678,
				Integer.MIN_VALUE, Integer.MIN_VALUE+500, Integer.MAX_VALUE-500};
			for (int idx = 0; idx != numvals.length; idx++) {
				byte[] barr = ByteOps.encodeInt(numvals[idx], size);
				int val = ByteOps.decodeInt(barr, 0, size);
				org.junit.Assert.assertEquals("size="+size+"/idx="+idx, numvals[idx], val);
				org.junit.Assert.assertEquals("size="+size+"/idx="+idx, size, barr.length);
			}
		}

		for (int size = 4; size <= 8; size++) {
			long[] numvals = new long[]{ByteOps.INTMASK, Integer.MAX_VALUE, Integer.MIN_VALUE&ByteOps.INTMASK,
				0xef028104L, 0x12345678L, Integer.MAX_VALUE+1L, Integer.MAX_VALUE+500L};
			for (int idx = 0; idx != numvals.length; idx++) {
				byte[] barr = ByteOps.encodeInt(numvals[idx], size);
				long val = ByteOps.decodeLong(barr, 0, size);
				org.junit.Assert.assertEquals("size="+size+"/idx="+idx, numvals[idx], val);
				org.junit.Assert.assertEquals("size="+size+"/idx="+idx, size, barr.length);
			}
		}

		//Values with non-zero upper byte set require the full 8-byte encoding
		long[] numvals = new long[]{-1L, Long.MIN_VALUE, Long.MAX_VALUE, Long.MIN_VALUE+500L, Long.MAX_VALUE-500L};
		int size = 8;
		for (int idx = 0; idx != numvals.length; idx++) {
			byte[] barr = ByteOps.encodeInt(numvals[idx], size);
			long val = ByteOps.decodeLong(barr, 0, size);
			org.junit.Assert.assertEquals("size="+size+"/idx="+idx, numvals[idx], val);
			org.junit.Assert.assertEquals("size="+size+"/idx="+idx, size, barr.length);
		}

		int numval = 0xef028104;
		byte[] barr = new byte[6];
		size = 4;
		int off = 1;
		int off2 = ByteOps.encodeInt(numval, barr, off, size);
		int val = ByteOps.decodeInt(barr, off, size);
		org.junit.Assert.assertEquals(numval, val);
		org.junit.Assert.assertEquals(off + size, off2);
	}