class MultipartEncoder
source · line 10public class MultipartEncoder public constructor(
/**
* The validated delimiter boundary used by this codec.
*/
public val boundary: MultipartBoundary) : Closeable
- Supertype
Closeable - Inherited
fun dispose(): Unit· Closeable
An in-memory multipart writer with explicit beginPart, body, endPart, and final finish. It performs no transport I/O and close does not emit a closing boundary.
function endPart
source · line 66public fun endPart(): Array<Byte>
Emits the part terminator after checking its declared body length is complete.
function finish
source · line 79public fun finish(): Array<Byte>
Emits the final closing boundary; no part may remain open.
function close
source · line 90public override fun close(): Unit
- Overrides
close
Releases local state without emitting bytes or finishing an incomplete message.
function writeBody
source · line 50public fun writeBody(buffer: NativeByteBuffer, count: Long = buffer.readableBytes): Array<Byte>
Consumes and returns part-body bytes, rejecting writes beyond a declared body length.
parameter count
source · line 50count: Long = buffer.readableBytes
parameter buffer
source · line 50buffer: NativeByteBuffer
property isClosed
source · line 23public val isClosed: Boolean
get: public read-only
Whether this codec has been closed.
getter get
source · line 23get(): Boolean
property isPartOpen
source · line 32public val isPartOpen: Boolean
get: public read-only
Whether a part is waiting for endPart.
getter get
source · line 32get(): Boolean
property boundary
source · line 14public val boundary: MultipartBoundary
get: public read-only
The validated delimiter boundary used by this codec.
constructor constructor
source · line 10constructor(public val boundary: MultipartBoundary)
parameter boundary
source · line 14public val boundary: MultipartBoundary
property isFinished
source · line 28public val isFinished: Boolean
get: public read-only
Whether the codec has completed its terminal operation and, for a decoder, drained pending events.
getter get
source · line 28get(): Boolean
function beginPart
source · line 37public fun beginPart(head: MultipartPartHead): Array<Byte>
Emits the boundary and validated part headers; the previous part must already be ended.
parameter head
source · line 37head: MultipartPartHead