ktor-server-core / io.ktor.features / CompressionEncoder

CompressionEncoder

interface CompressionEncoder

Represents a Compression encoder

Functions

compress

abstract fun compress(readChannel: ByteReadChannel, coroutineContext: <ERROR CLASS> = Dispatchers.Unconfined): ByteReadChannel

Wraps readChannel into a compressing ByteReadChannel

abstract fun compress(writeChannel: ByteWriteChannel, coroutineContext: <ERROR CLASS> = Dispatchers.Unconfined): ByteWriteChannel

Wraps writeChannel into a compressing ByteWriteChannel

predictCompressedLength

open fun predictCompressedLength(originalLength: Long): Long?

May predict compressed length based on the originalLength or return null if it is impossible.

Inheritors

DeflateEncoder

object DeflateEncoder : CompressionEncoder

Implementation of the deflate encoder

GzipEncoder

object GzipEncoder : CompressionEncoder

Implementation of the gzip encoder

IdentityEncoder

object IdentityEncoder : CompressionEncoder

Implementation of the identity encoder