Move (de)compression helpers to akka-stream module #21395 (#21409)

* Move (de)compression helpers to akka-stream #21395

* Move compression and decompression -related classes from
  akka-http-experimental to akka-stream
* Add Compression helper object with functions to create
  decompressing Flows
* Add a short cookbook entry

* =str move compression impl classes into their own directory (and change visibility)

* =str also expose gzip/deflate compression flows

* Fix formatting of plural ByteStrings in cookbook

* =str #21395 make compressor call Deflater.end in postStop to release resources

Also simplified the creation of the flow given a compressor.

* =str #21395 decompressors call Inflater.end in postStop to release resources

* =str #21395 smallish Scaladoc fixes
This commit is contained in:
Olli Helenius 2016-11-17 23:42:37 +02:00 committed by Konrad Malawski
parent d7af58bafa
commit 658b46e1cc
14 changed files with 618 additions and 0 deletions

View file

@ -100,6 +100,16 @@ The :class:`Framing` helper object contains a convenience method to parse messag
.. includecode:: ../code/docs/stream/cookbook/RecipeParseLines.scala#parse-lines
Dealing with compressed data streams
------------------------------------
**Situation:** A gzipped stream of bytes is given as a stream of ``ByteString`` s, for example from a ``FileIO`` source.
The :class:`Compression` helper object contains convenience methods for decompressing data streams compressed with
Gzip or Deflate.
.. includecode:: ../code/docs/stream/cookbook/RecipeDecompress.scala#decompress-gzip
Implementing reduce-by-key
--------------------------