+str add java Compression.gzip and deflate (#23779)
This commit is contained in:
parent
ae0b9fe081
commit
d706d5344b
1 changed files with 18 additions and 0 deletions
|
|
@ -23,4 +23,22 @@ object Compression {
|
|||
*/
|
||||
def inflate(maxBytesPerChunk: Int): Flow[ByteString, ByteString, NotUsed] =
|
||||
scaladsl.Compression.inflate(maxBytesPerChunk).asJava
|
||||
|
||||
/**
|
||||
* Creates a flow that gzip-compresses a stream of ByteStrings. Note that the compressor
|
||||
* will SYNC_FLUSH after every [[ByteString]] so that it is guaranteed that every [[ByteString]]
|
||||
* coming out of the flow can be fully decompressed without waiting for additional data. This may
|
||||
* come at a compression performance cost for very small chunks.
|
||||
*/
|
||||
def gzip: Flow[ByteString, ByteString, NotUsed] =
|
||||
scaladsl.Compression.gzip.asJava
|
||||
|
||||
/**
|
||||
* Creates a flow that deflate-compresses a stream of ByteString. Note that the compressor
|
||||
* will SYNC_FLUSH after every [[ByteString]] so that it is guaranteed that every [[ByteString]]
|
||||
* coming out of the flow can be fully decompressed without waiting for additional data. This may
|
||||
* come at a compression performance cost for very small chunks.
|
||||
*/
|
||||
def deflate: Flow[ByteString, ByteString, NotUsed] =
|
||||
scaladsl.Compression.deflate.asJava
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue