dev.pellet.server.codec.Codec.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pellet-server Show documentation
Show all versions of pellet-server Show documentation
An opinionated Kotlin web framework, with best-practices built-in
package dev.pellet.server.codec
import dev.pellet.server.buffer.PelletBuffer
/**
* A codec maintains internal state, such that it can interpret a bag of bytes given to it, and output objects to a
* [CodecHandler] instance.
*
* For example, reading HTTP 1.1 requires a codec to keep track of whether you're reading the request line, headers,
* a fixed or streaming entity, etc.
*/
interface Codec {
fun clear()
fun release()
suspend fun consume(buffer: PelletBuffer)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy