All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.com.algolia.search.transport.internal.Gzip.kt Maven / Gradle / Ivy

Go to download

"Algolia is a powerful search-as-a-service solution, made easy to use with API clients, UI libraries, and pre-built integrations. Algolia API Client for Kotlin lets you easily use the Algolia Search REST API from your JVM project, such as Android or backend implementations."

There is a newer version: 3.12.2
Show newest version
package com.algolia.search.transport.internal

import io.ktor.util.GZip
import io.ktor.util.toByteArray
import io.ktor.utils.io.ByteReadChannel
import kotlinx.coroutines.runBlocking

internal actual object Gzip : (String) -> ByteArray {

    @Suppress("EXPERIMENTAL_API_USAGE")
    override fun invoke(input: String): ByteArray {
        return runBlocking {
            GZip.run {
                encode(ByteReadChannel(input)).toByteArray()
            }
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy