         
         let pos = self.endOfFile
         
-        self.endOfFile = pos + CUnsignedLongLong(sizeof(T))
+        self.endOfFile = pos + CUnsignedLongLong(sizeof(O))
         
         return pos;
     }

    
    // #pragma mark - CRUD Objects
    
    func registerObject(inout aObj: T) -> UID? {
        
        if aObj.dirty {
            // only NEW object can be registered,

            // store SampleData as ID:0 in the file
            // ID:0 is a reserved ID and should not be availabled for public access

            let sampleObject = O()
            let sampleData = sampleObject.encodeData()
            
            self.create(sampleData)
