He-Pin commented on code in PR #2409:
URL: https://github.com/apache/pekko/pull/2409#discussion_r2472229497


##########
stream/src/main/scala/org/apache/pekko/stream/scaladsl/Compression.scala:
##########
@@ -85,4 +87,28 @@ object Compression {
    */
   def inflate(maxBytesPerChunk: Int, nowrap: Boolean): Flow[ByteString, 
ByteString, NotUsed] =
     Flow[ByteString].via(new DeflateDecompressor(maxBytesPerChunk, 
nowrap)).named("inflate")
+
+  /**
+   * @since 2.0.0
+   */
+  def zstd: Flow[ByteString, ByteString, NotUsed] = 
zstd(Zstd.defaultCompressionLevel())
+
+  /**
+   * Same as [[zstd]] with a custom level and an optional dictionary.
+   * @param level The compression level, must be greater or equal to 
[[Zstd.minCompressionLevel]] and less than or equal
+   *              to [[Zstd.maxCompressionLevel]]
+   * @param dictionary An optional dictionary that can be used for compression
+   * @since 2.0.0
+   */
+  def zstd(level: Int, dictionary: Option[ZstdDictCompress] = None): 
Flow[ByteString, ByteString, NotUsed] = {
+    require(level <= Zstd.maxCompressionLevel() && level >= 
Zstd.minCompressionLevel())
+    CompressionUtils.compressorFlow(() => new ZstdCompressor(level, 
dictionary))
+  }
+
+  /**
+   * @since 2.0.0
+   */
+  def zstdDecompress(maxBytesPerChunk: Int = MaxBytesPerChunkDefault): 
Flow[ByteString, ByteString, NotUsed] =
+    Flow[ByteString].via(new 
ZstdDecompressor(maxBytesPerChunk)).named("zstdDecompress")

Review Comment:
   I mean, what if the user wants to use it in Android?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to