garbagetown/playdocja — pull request #599 by wm3 (2014-03-17 22:56:54+00:00)
Title: manual/scalaGuide/main/async/ScalaStream.md

- https://github.com/garbagetown/playdocja/blob/2.2.0/documentation/2.2.0/manual/scalaGuide/main/async/ScalaStream.md
```
--- /Users/garbagetown/Desktop/2.1.5/manual/scalaGuide/main/async/ScalaStream.md	2013-09-19 22:53:02.000000000 +0900
+++ /Users/garbagetown/Desktop/2.2.0/manual/scalaGuide/main/async/ScalaStream.md	2013-09-19 10:11:22.000000000 +0900
@@ -86,7 +86,7 @@

This helper will also compute the `Content-Type` header from the file name, and add the `Content-Disposition` header to specify how the web browser should handle this response. The default is to ask the web browser to download this file by adding the header `Content-Disposition: attachment; filename=fileToServe.pdf` to the HTTP response.

-You also provide your own file name:
+You can also provide your own file name:

'''scala
def index = Action {
@@ -120,7 +120,7 @@
>
> The size of each chunk is sent right before the chunk itself, so that a client can tell when it has finished receiving data for that chunk. Data transfer is terminated by a final chunk of length zero.
>
-> [[http://en.wikipedia.org/wiki/Chunked_transfer_encoding]]
+>

The advantage is that we can serve the data **live**, meaning that we send chunks of data as soon as they are available. The drawback is that since the web browser doesn’t know the content size, it is not able to display a proper download progress bar.

@@ -154,7 +154,7 @@
val data = getDataStream
val dataContent: Enumerator[Array[Byte]] = Enumerator.fromStream(data)

- Ok.stream(dataContent)
+ Ok.chunked(dataContent)
}
'''

@@ -162,7 +162,7 @@

'''scala
def index = Action {
- Ok.stream(
+ Ok.chunked(
Enumerator("kiki", "foo", "bar").andThen(Enumerator.eof)
)
}
@@ -187,4 +187,4 @@

We get three chunks followed by one final empty chunk that closes the response.

-> **Next:** [[Comet sockets | ScalaComet]]
\ No newline at end of file
+> **Next:** [[Comet sockets | ScalaComet]]

```