zt
08/12/2024, 4:02 AMinternal object BrotliEncoder : ContentEncoder {
override val name = "br"
override fun CoroutineScope.encode(source: ByteReadChannel): ByteReadChannel {
error("BrotliOutputStream not available (<https://github.com/google/brotli/issues/715>)")
}
override fun CoroutineScope.decode(source: ByteReadChannel): ByteReadChannel {
return BrotliInputStream(source.toInputStream()).toByteReadChannel()
}
}
fun ContentEncoding.Config.brotli(quality: Float? = null) {
customEncoder(BrotliEncoder, quality)
}
Aleksei Tirman [JB]
08/12/2024, 8:19 AMzt
08/12/2024, 8:37 PMAleksei Tirman [JB]
08/13/2024, 7:36 AMobject BrotliEncoder : ContentEncoder, Encoder by BrotliEncoder {
override val name = "br"
override fun decode(source: ByteReadChannel, coroutineContext: CoroutineContext): ByteReadChannel {
return BrotliInputStream(source.toInputStream()).toByteReadChannel()
}
override fun encode(source: ByteReadChannel, coroutineContext: CoroutineContext): ByteReadChannel {
error("BrotliOutputStream not available (<https://github.com/google/brotli/issues/715>)")
}
override fun encode(source: ByteWriteChannel, coroutineContext: CoroutineContext): ByteWriteChannel {
error("BrotliOutputStream not available (<https://github.com/google/brotli/issues/715>)")
}
}
fun ContentEncodingConfig.brotli(quality: Float? = null) {
customEncoder(BrotliEncoder, quality)
}
Can you elaborate on the problem you experience?zt
08/13/2024, 3:57 PM