     var fileSize:UInt64? {
         if  fileHandle != nil{
             let prevOffset = fileHandle.offsetInFile
-            fileHandle.seekToEndOfFile()
-            let size = fileHandle.offsetInFile
+            let size = fileHandle.seekToEndOfFile()
             fileHandle.seek(toFileOffset: prevOffset)
             return size
         }


import Foundation


class StreamReader {
    
    let encoding:String.Encoding
    let chunkSize: Int
    
    var fileHandle:FileHandle!
    let buffer:NSMutableData!
    let delimData:NSData!
    var atEOF:Bool = false
    
    
    
    init?(path:String, delimiter:String = "\n", encoding:String.Encoding = .utf8 , chunkSize:Int = 2048){
        self.encoding = encoding

        }
    }
    
    deinit{
        close()
    }
}




