public int marshalledLength(final ObjectContainerBase stream, final ClassMetadata clazz) { final IntByRef len = new IntByRef( stream.stringIO().shortLength(clazz.nameToWrite()) + Const4.OBJECT_LENGTH + (Const4.INT_LENGTH * 2) + (Const4.ID_LENGTH)); len.value += clazz.index().ownLength(); clazz.forEachDeclaredAspect( new Procedure4() { public void apply(Object arg) { len.value += _family._field.marshalledLength(stream, (ClassAspect) arg); } }); return len.value; }
public void write( final Transaction trans, final ClassMetadata clazz, final ByteArrayBuffer writer) { writer.writeShortString(trans, clazz.nameToWrite()); int intFormerlyKnownAsMetaClassID = 0; writer.writeInt(intFormerlyKnownAsMetaClassID); writer.writeIDOf(trans, clazz.i_ancestor); writeIndex(trans, clazz, writer); writer.writeInt(clazz.declaredAspectCount()); clazz.forEachDeclaredAspect( new Procedure4() { public void apply(Object arg) { _family._field.write(trans, clazz, (ClassAspect) arg, writer); } }); }