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

IdentityEncoder

object IdentityEncoder : CompressionEncoder

Implementation of the identity encoder

Functions

compress

fun compress(readChannel: ByteReadChannel, coroutineContext: <ERROR CLASS>): ByteReadChannel

Wraps readChannel into a compressing ByteReadChannel

fun compress(writeChannel: ByteWriteChannel, coroutineContext: <ERROR CLASS>): ByteWriteChannel

Wraps writeChannel into a compressing ByteWriteChannel

predictCompressedLength

fun predictCompressedLength(originalLength: Long): Long

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