         return self.fileHandle.readDataOfLength(sizeof(D));
     }
     
+    func read<T>() -> T! {
+        let data : NSData! = self.fileHandle.readDataOfLength(sizeof(T));
+        
+        if data != nil {
+            
+            var result : T! = nil
+            
+            data.getBytes(&result, length: sizeof(T))
+            
+            return result
+        }
+        
+        return nil
+    }
     
     // #pragma mark WRITE -------------------------------------------------------
     

    
    // #pragma mark - read/write header
    
    func readHeader() -> H! {
        
        let data = self.fileHandle.readDataOfLength(sizeof(H))
        
        // works only by value?
        if data {
            var result = H()
            
            data.getBytes(&result)
            
            return result

            
            let pos = calculatePos(index)
            
            if (newValue != nil) {
                if (pos > endOfFile) {
                    // TODO: error
                } else {
