We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
check
1 parent 06621fa commit 4b4c628Copy full SHA for 4b4c628
runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/compression/GzipCompressor.kt
@@ -100,9 +100,7 @@ internal class GzipCompressor : Closeable {
100
stream.avail_out = BUFFER_SIZE.toUInt()
101
102
val deflateResult = deflate(stream.ptr, Z_FINISH)
103
- if (deflateResult != Z_STREAM_END && deflateResult != Z_OK) {
104
- throw RuntimeException("Deflate failed during finish with error code $deflateResult")
105
- }
+ check(deflateResult == Z_OK || deflateResult == Z_STREAM_END) { "Deflate failed during finish with error code $deflateResult" }
106
107
val bytesWritten = BUFFER_SIZE - stream.avail_out.toInt()
108
outputBuffer.addAll(buffer.take(bytesWritten))
0 commit comments