}
protected Object readWrite(Object inObject) throws Exception
{
// Serialize
WireFormat wireFormat = getWireFormat();
ByteArrayOutputStream out = new ByteArrayOutputStream();
wireFormat.write(out, inObject, "UTF-8");
// De-serialize
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
Object outMessage = wireFormat.read(in);
assertNotNull(outMessage);
return outMessage;
}