gzipCompress

expect suspend fun gzipCompress(data: ByteArray): ByteArray(source)

Gzip codec used for session exports.

Session JSON is dominated by repeated keys, repeated urls and header names, and JSON response bodies, all of which deflate compresses heavily, so exports are stored and transferred gzipped and inflated once on import.

Both functions suspend because the only gzip primitive available in a browser is the Web Streams API, which is asynchronous. Every other platform implements them without suspending.

Usage:

val bytes = gzipCompress(exportJson.encodeToByteArray())
val json = gzipDecompress(bytes).decodeToString()
actual suspend fun gzipCompress(data: ByteArray): ByteArray(source)

Gzip codec used for session exports.

Session JSON is dominated by repeated keys, repeated urls and header names, and JSON response bodies, all of which deflate compresses heavily, so exports are stored and transferred gzipped and inflated once on import.

Both functions suspend because the only gzip primitive available in a browser is the Web Streams API, which is asynchronous. Every other platform implements them without suspending.

Usage:

val bytes = gzipCompress(exportJson.encodeToByteArray())
val json = gzipDecompress(bytes).decodeToString()
actual suspend fun gzipCompress(data: ByteArray): ByteArray(source)

Gzip codec used for session exports.

Session JSON is dominated by repeated keys, repeated urls and header names, and JSON response bodies, all of which deflate compresses heavily, so exports are stored and transferred gzipped and inflated once on import.

Both functions suspend because the only gzip primitive available in a browser is the Web Streams API, which is asynchronous. Every other platform implements them without suspending.

Usage:

val bytes = gzipCompress(exportJson.encodeToByteArray())
val json = gzipDecompress(bytes).decodeToString()
actual suspend fun gzipCompress(data: ByteArray): ByteArray(source)

Gzip codec used for session exports.

Session JSON is dominated by repeated keys, repeated urls and header names, and JSON response bodies, all of which deflate compresses heavily, so exports are stored and transferred gzipped and inflated once on import.

Both functions suspend because the only gzip primitive available in a browser is the Web Streams API, which is asynchronous. Every other platform implements them without suspending.

Usage:

val bytes = gzipCompress(exportJson.encodeToByteArray())
val json = gzipDecompress(bytes).decodeToString()