final StorageInfo storageInfo = new StorageInfo();
final int offset = storageInfo.getHeaderDataSize();
final ObjectAndPersistInfo objectAndPersistInfo =
/**/new ObjectAndPersistInfo(toSerialize, false, classInfo,
storageInfo);
final IObjectOutput objectOutput = new ObjectOutputSerializable(this,
classInfoFactory, proxyManager2, helperBinaryConversion);
// prepare write
objectOutput.prepareWrite(objectAndPersistInfo);
assertTrue("must have value changed since a new object",
objectOutput.isValueChanged(objectAndPersistInfo));
assertNull("for initial write must not have original value",
objectAndPersistInfo.originalValue);
// storageInfo.setHeaderDataSize(offset);
final int byteSize = objectOutput
.byteSize(objectAndPersistInfo, offset);
final byte[] binary = new byte[byteSize];
// write
final ObjectClassInfoAndDeclared[] sons = objectOutput
.writeBody(binary, offset, objectAndPersistInfo, true/* updateOriginalValue */);
return new WriteResult(objectAndPersistInfo, sons, binary);
}