@@ -6,7 +6,6 @@ package aws.smithy.kotlin.runtime.io
66
77import aws.smithy.kotlin.runtime.InternalApi
88import aws.smithy.kotlin.runtime.compression.GzipCompressor
9- import kotlinx.coroutines.runBlocking
109
1110/* *
1211 * Wraps an [SdkSource], compressing bytes read into GZIP format.
@@ -28,13 +27,13 @@ public actual class GzipSdkSource actual constructor(public val source: SdkSourc
2827
2928 if (rc > 0 ) {
3029 val input = temp.readByteArray(rc)
31- runBlocking { compressor.update(input) }
30+ compressor.update(input)
3231 }
3332 }
3433
3534 // If still no data is available, we've hit EOF. Close the compressor and write the remaining bytes
3635 if (compressor.availableForRead == 0 ) {
37- val terminationBytes = runBlocking { compressor.flush() }
36+ val terminationBytes = compressor.flush()
3837 sink.write(terminationBytes)
3938 return terminationBytes.size.toLong().also {
4039 compressor.close()
@@ -43,7 +42,7 @@ public actual class GzipSdkSource actual constructor(public val source: SdkSourc
4342
4443 // Read compressed bytes from the compressor
4544 val bytesToRead = minOf(limit, compressor.availableForRead.toLong())
46- val compressed = runBlocking { compressor.consume(bytesToRead.toInt()) }
45+ val compressed = compressor.consume(bytesToRead.toInt())
4746 sink.write(compressed)
4847 return compressed.size.toLong()
4948 }
0 commit comments