Class ZipContentCodecBuilder
-
Method Summary
Modifier and TypeMethodDescriptionabstract ContentCodecbuild()Deprecated.Build and return an instance of theContentCodecwith the configuration of the builder.final ZipContentCodecBuildermaxChunkSize(int maxChunkSize) Deprecated.Set the max allowed chunk size the decoder may emit in a single inflate step.final ZipContentCodecBuildermaxDecompressedBytes(long maxDecompressedBytes) Deprecated.Set the maximum cumulative size in bytes of the decompressed payload produced by a single aggregateddecodecall.final ZipContentCodecBuilderwithCompressionLevel(int compressionLevel) Deprecated.Sets the compression level for this codec's encoder.
-
Method Details
-
withCompressionLevel
Deprecated.Sets the compression level for this codec's encoder.- Parameters:
compressionLevel- 1 yields the fastest compression and 9 yields the best compression, 0 means no compression.- Returns:
this
-
maxChunkSize
Deprecated.Set the max allowed chunk size the decoder may emit in a single inflate step. This does not bound the total decompressed payload size; seemaxDecompressedBytes(long)for that.- Parameters:
maxChunkSize- the max allowed chunk size to inflate during decoding.- Returns:
this
-
maxDecompressedBytes
Deprecated.Set the maximum cumulative size in bytes of the decompressed payload produced by a single aggregateddecodecall. When the limit is exceeded the operation fails with aCodecDecodingException. Used to defend against decompression-bomb inputs where a small compressed payload expands to an unbounded amount of memory.Unlike
maxChunkSize(int), which bounds only a single inflate step inside the codec, this bound is tracked across every chunk produced for the same input.Defaults to 64 MiB. The default can be overridden process-wide via the "io.servicetalk.encoding.netty.maxDecompressedBytes" system property (intended as an operational escape hatch for unforeseen issues — prefer per-builder configuration). A value of
0disables the limit; callers that decode trusted input and need unbounded decompression can opt out, but doing so re-exposes the decompression-bomb attack surface.This setting does not apply to the streaming
ContentCodec.decode(io.servicetalk.concurrent.api.Publisher, io.servicetalk.buffer.api.BufferAllocator)path. Streaming consumers typically process much larger payloads and are assumed to apply back-pressure; a streaming client that aggregates decoded chunks into a single buffer should enforce its own size bound.- Parameters:
maxDecompressedBytes- the max total decompressed bytes allowed per aggregated decode, or0for unbounded.- Returns:
this
-
build
Deprecated.Build and return an instance of theContentCodecwith the configuration of the builder.- Returns:
- the
ContentCodecwith the configuration of the builder
-
ZipCompressionBuilder.