File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/compression Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 44 */
55package aws.smithy.kotlin.runtime.compression
66
7- import aws.sdk.kotlin.crt.use
87import aws.smithy.kotlin.runtime.content.ByteStream
98import aws.smithy.kotlin.runtime.content.asByteStream
109import aws.smithy.kotlin.runtime.io.GzipByteReadChannel
1110import aws.smithy.kotlin.runtime.io.GzipSdkSource
1211import aws.smithy.kotlin.runtime.io.SdkByteReadChannel
1312import aws.smithy.kotlin.runtime.io.SdkSource
13+ import aws.smithy.kotlin.runtime.io.readToByteArray
14+ import aws.smithy.kotlin.runtime.io.source
1415import kotlinx.coroutines.runBlocking
1516
1617/* *
@@ -37,16 +38,12 @@ public actual class Gzip : CompressionAlgorithm {
3738 }
3839
3940 is ByteStream .Buffer -> {
40- val sourceBytes = stream.bytes()
41- if (sourceBytes .isEmpty()) {
41+ val bytes = stream.bytes()
42+ if (bytes .isEmpty()) {
4243 stream
4344 } else {
4445 runBlocking {
45- GzipCompressor ().use {
46- it.apply {
47- update(sourceBytes)
48- }.flush()
49- }.asByteStream()
46+ GzipSdkSource (bytes.source()).readToByteArray().asByteStream()
5047 }
5148 }
5249 }
You can’t perform that action at this time.
0 commit comments