	@Test
	public void testWriteInt() {

		try {
			ByteArrayOutputStream bout = new ByteArrayOutputStream();
			
			IOUtil.writeInt(bout, 3);
			IOUtil.writeInt(bout, 4);
			IOUtil.writeInt(bout, 0xFF0000AA);
			IOUtil.writeInt(bout, 0xAABBCCDD);
			
			ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
			
			long a = IOUtil.readInt(bin);
			assertEquals(a, 3);
			
			long b = IOUtil.readInt(bin);
			assertEquals(b, 4);
			
			long c = IOUtil.readInt(bin);
			assertEquals(c, 0xFF0000AA);
			
			long d = IOUtil.readInt(bin);
			assertEquals(d, 0xAABBCCDD);
			
		} catch (IOException e) {
			fail("Exception thrown: "+e);
		}
	}