ByteArrayOutputStream baos = new ByteArrayOutputStream();
PmOutputStream pos = new PmOutputStream(baos);
pos.writeModel(p0);
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
PmInputStream pis = new PmInputStream(bais);
Primitives p1 = pis.readModel();
Assert.assertEquals(0, pis.available());
pos.close();
pis.close();
Assert.assertEquals(p0.isBooleanValue(), p1.isBooleanValue());
Assert.assertEquals(p0.getByteValue(), p1.getByteValue());
Assert.assertEquals(p0.getCharValue(), p1.getCharValue());
Assert.assertEquals(p0.getShortValue(), p1.getShortValue());