Object toWrite = fooClass.newInstance();
ByteArrayOutputStream bout = new ByteArrayOutputStream();
MarshalOutputStream mout =
new MarshalOutputStream(bout, Collections.EMPTY_LIST);
mout.writeObject(toWrite);
mout.flush();
ByteArrayInputStream bin =
new ByteArrayInputStream(bout.toByteArray());
MarshalInputStream min =