public static Db4objects.Db4o.Internal.Marshall.ObjectHeader Defrag(DefragmentContextImpl context) { ByteArrayBuffer source = context.SourceBuffer(); ByteArrayBuffer target = context.TargetBuffer(); Db4objects.Db4o.Internal.Marshall.ObjectHeader header = new Db4objects.Db4o.Internal.Marshall.ObjectHeader (context.Services().SystemTrans().Container(), null, source); int newID = context.Mapping().StrictMappedID(header.ClassMetadata().GetID()); Db4objects.Db4o.Internal.Marshall.SlotFormat slotFormat = header.SlotFormat(); slotFormat.WriteObjectClassID(target, newID); slotFormat.SkipMarshallerInfo(target); slotFormat.ReadHeaderAttributes(target); return header; }