55package aws.smithy.kotlin.runtime.compression
66
77import aws.sdk.kotlin.crt.Closeable
8+ import aws.smithy.kotlin.runtime.io.SdkBuffer
89import aws.smithy.kotlin.runtime.io.SdkByteChannel
910import aws.smithy.kotlin.runtime.io.readFully
11+ import aws.smithy.kotlin.runtime.io.readToByteArray
12+ import aws.smithy.kotlin.runtime.io.use
1013import aws.smithy.kotlin.runtime.io.write
1114import kotlinx.cinterop.*
1215import platform.zlib.*
13- import aws.smithy.kotlin.runtime.io.SdkBuffer
14- import aws.smithy.kotlin.runtime.io.readToByteArray
15- import aws.smithy.kotlin.runtime.io.use
1616
1717private const val DEFAULT_WINDOW_BITS = 15 // Default window bits
1818private const val WINDOW_BITS_GZIP_OFFSET = 16 // Gzip offset for window bits
@@ -53,7 +53,7 @@ internal class GzipCompressor : Closeable {
5353 * Update the compressor with [input] bytes
5454 */
5555 suspend fun update (input : ByteArray ) = memScoped {
56- check (! isClosed) { " Compressor is closed" }
56+ check(! isClosed) { " Compressor is closed" }
5757
5858 val inputPin = input.pin()
5959
@@ -83,7 +83,7 @@ internal class GzipCompressor : Closeable {
8383 * Consume [count] gzip-compressed bytes.
8484 */
8585 suspend fun consume (count : Int ): ByteArray {
86- check (! isClosed) { " Compressor is closed" }
86+ check(! isClosed) { " Compressor is closed" }
8787 require(count in 0 .. availableForRead) {
8888 " Count must be between 0 and $availableForRead , got $count "
8989 }
@@ -98,7 +98,7 @@ internal class GzipCompressor : Closeable {
9898 * Flush the compressor and return the terminal sequence of bytes that represent the end of the gzip compression.
9999 */
100100 suspend fun flush (): ByteArray {
101- check (! isClosed) { " Compressor is closed" }
101+ check(! isClosed) { " Compressor is closed" }
102102
103103 memScoped {
104104 val compressionBuffer = ByteArray (BUFFER_SIZE )
0 commit comments