spray/spray — pull request #517 by jrudolph (2013-09-18 15:47:31+00:00)
Title: make HttpData.toChunkStream return Stream[HttpData]

This is a preliminary PR to #515. It changes `HttpData.toChunkStream` to return a `Stream[HttpData]` instead of `ByteString` and also adds a new method `sliceData` in the same vein which returns the slice as a `HttpData`. The improvement for both methods is that no data copying is necessary at all.

Also I added an optimization for `Compound.toByteString` to be directly implemented in terms of compound `ByteStrings`. This should avoid copying data around for cases where none of the parts are `FileBytes`.

This adds lots of tests for `HttpData` methods.