title: How do I extract a Future[String] from an akka Source[ByteString, _]?
body: <p>I am attempting to stream a file using akka streams and am running into a small issue extracting the results of the stream into a Future[String]:</p>
  
  <pre><code>def streamMigrationFile(source: Source[ByteString, _]): Future[String] = {
    var fileString = ""
    val sink = Sink.foreach[ByteString](byteString =&gt; fileString = 
      fileString.concat(byteString.decodeString("US-ASCII")))
    source.runWith(sink)
  }
  </code></pre>
  
  <p>I'm getting a compilation error:</p>
  
  <pre><code>Expression of type Future[Done] does not conform to expected type Future[String]
  </code></pre>
  
  <p>Can anyone help me understand what I'm doing wrong and what I need to do to extract the results of the stream?</p>