KetraTerm
API · DevelopmentAll versions

TerminalGraphicsOutputParser

Optional synchronous parser boundary for externally decoded image payloads.

A session retains its ingress range and mutation admission while releasing its core lock around consumePendingGraphics. No parser operation may run concurrently or reenter the consumer. Ordinary accept retains its full-range sink-dispatch contract; hosts requiring PNG/zlib decoding use acceptUntilGraphics instead. Parsers returned by TerminalParsers implement this boundary.

Properties

Link copied to clipboard

Whether a completed image payload awaits consumePendingGraphics.

Functions

Link copied to clipboard
abstract fun accept(bytes: ByteArray, offset: Int = 0, length: Int = bytes.size - offset)

Feeds a chunk of bytes from the terminal host output stream to the parser.

Link copied to clipboard
abstract fun acceptByte(byteValue: Int)

Feeds a single byte from the terminal host output stream to the parser.

Link copied to clipboard
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.

Link copied to clipboard

Consumes the pending controls and the used prefix of exclusively owned staging. The consumer may compact staging in place. Neither controls nor bytes may escape this callback. Staging is released on return, including failure.

Link copied to clipboard
abstract fun endOfInput()

Signals the end of the input stream.

Link copied to clipboard
abstract fun reset()

Resets the internal parser state, discarding any partially parsed sequences or control signatures.