   fd = fs.openSync(path, "r");
   try
     offset = 0
-    remainder = null
+    remainder = ''
     return if isBinaryFile(headerBuffer, fs.readSync(fd, headerBuffer, 0, 256))
 
     chunkedBuffer ?= new Buffer(chunkSize)

  while i--
    return i if buffer[i] == char
  -1

concat = (str1, str2) ->
  if str1? and str2?
    str1 + str2
  else if not str1? and not str2?
    ''
  else if str1?
    str1
  else
    str2

headerBuffer = new Buffer(256)
chunkedBuffer = null

        lines = str.split('\n')

      if not lines? or lines.length == 0
        remainder = remainder + newRemainder
      else
        lines[0] = remainder + lines[0] if remainder
        callback(lines, line)
        remainder = newRemainder

