Class Coders$
java.lang.Object
org.apache.pekko.http.scaladsl.coding.Coders$
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.pekko.http.scaladsl.coding.Coders.messagedecodeMessage(HttpMessage message, scala.collection.immutable.Seq<Decoder> decoders) Decodes the message with the one ofdecoderswhose encoding matches the message'sContent-Encodingheader, for example to decode a response on the client side without checking its encoding first.scala.collection.immutable.Seq<Coder>Deflate()Deflate(scala.Function1<HttpMessage, Object> messageFilter, int compressionLevel) Gzip()Gzip(scala.Function1<HttpMessage, Object> messageFilter, int compressionLevel) NoCoding()Zstd()A coder for the 'zstd' encoding.Zstd(scala.Function1<HttpMessage, Object> messageFilter, int compressionLevel, int windowLogMax) A coder for the 'zstd' encoding with a custom message filter, compression level and decoder window limit, seeZstd.
-
Field Details
-
MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Constructor Details
-
Coders$
public Coders$()
-
-
Method Details
-
Gzip
-
Gzip
-
Deflate
-
Deflate
-
NoCoding
-
Zstd
A coder for the 'zstd' encoding. It is not one of theDefaultCoders(), as it needs the optionalcom.github.luben:zstd-jnidependency on the classpath, version 1.5.7-25 or later.Following RFC 9659, it does not compress with a window larger than 8 MB, and does not decode frames that need a larger window, so that a peer cannot make it allocate more memory than that for one message.
- Returns:
- (undocumented)
- Since:
- 2.0.0
-
Zstd
public Coder Zstd(scala.Function1<HttpMessage, Object> messageFilter, int compressionLevel, int windowLogMax) A coder for the 'zstd' encoding with a custom message filter, compression level and decoder window limit, seeZstd.- Parameters:
compressionLevel- must be betweenCompression.ZstdMinCompressionLevelandCompression.ZstdMaxCompressionLevelof pekko-streamwindowLogMax- the log2 of the largest window that the decoder accepts, 23 (8 MB, the limit of RFC 9659) by default. It must be 0 or betweenCompression.ZstdMinWindowLogandCompression.ZstdMaxWindowLogof pekko-stream; 0 uses the limit of libzstd (128 MB) and also works with versions of zstd-jni older than 1.5.7-25messageFilter- (undocumented)- Returns:
- (undocumented)
- Since:
- 2.0.0
-
DefaultCoders
-
decodeMessage
public org.apache.pekko.http.scaladsl.coding.Coders.message decodeMessage(HttpMessage message, scala.collection.immutable.Seq<Decoder> decoders) Decodes the message with the one ofdecoderswhose encoding matches the message'sContent-Encodingheader, for example to decode a response on the client side without checking its encoding first.The message is returned unchanged if it has no
Content-Encodingheader, if none ofdecodersmatches its encoding, or if the header lists more than one encoding. In the last two cases theContent-Encodingheader is kept, somessage.encodingshows that the entity is still encoded.- Parameters:
decoders- the decoders to choose from,Zstdis not one of theDefaultCoders()message- (undocumented)- Returns:
- (undocumented)
- Since:
- 2.0.0
-