ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectWriter writer = new ObjectWriter(this, baos);
writer.writeObject(o);
writer.close();
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
ObjectReader in = new ObjectReader(this, bais);
return (O) in.readObject();
}