     var fileOffset : Int = 1
     
     // data.length + header.length;
-    let dataSize = sizeof(H) + sizeof(D)  // test as CUnsignedLongLong
+    let headerSize = sizeof(H)
+    let dataSize = sizeof(D)
+    let blockSize = sizeof(H) + sizeof(D)  // test as CUnsignedLongLong
     
     var endOfFile: CUnsignedLongLong = 0;
     var unusedDataSegments =  Dictionary<CUnsignedLongLong,Bool>()

    
    func calculatePos(aID: UID) -> CUnsignedLongLong {
        
        return CUnsignedLongLong((aID * self.dataSize) + self.fileOffset)
    
    }
    
    func calculateID(pos: CUnsignedLongLong) -> UID {
        
        var result = (Int(pos) - self.fileOffset) / self.dataSize;
        
        return result
    }

            newFile = true
        }
        
        self.fileHandle = NSFileHandle.fileHandleForUpdatingURL(url, error: &self.error)
        self.endOfFile = self.fileHandle.seekToEndOfFile()
        
        readUnusedDataSegments()
    }
    
    // override in subclasses and update fileOffset if required
