KetraTerm
API · DevelopmentAll versions

acceptUntilGraphics

abstract fun acceptUntilGraphics(bytes: ByteArray, offset: Int, length: Int): Int

Consumes through the first graphics command requiring external decoding. Other commands dispatch synchronously. A yielded command has not reached the sink; consume it before supplying further bytes, including an empty range.

Return

consumed byte count, including the graphics string terminator; equals length when no earlier yield occurred. Check hasPendingGraphics even when all supplied bytes were consumed.

Parameters

bytes

borrowed ingress storage, unchanged by parsing.

offset

first byte of the selected range.

length

number of bytes available from offset.

Throws

if the range is outside bytes.

if a previous payload is pending or the parser is reentered.