PrefixedByteStream

A ByteStream that serves prefix bytes first, then delegates to raw. Lets the engine peek the opening bytes of an inbound connection (to tell plaintext from MSE) and then hand them back to the chosen handler as if never consumed.

Constructors

Link copied to clipboard
constructor(prefix: ByteArray, raw: ByteStream)

Properties

Link copied to clipboard
open override val remoteAddress: String

A human-readable identifier for the remote end, for logging.

Functions

Link copied to clipboard
open suspend override fun readExactly(n: Int): ByteArray

Suspend until exactly n bytes have been read, then return them.

Link copied to clipboard
open suspend override fun write(bytes: ByteArray)

Write bytes in full (and flush, for a socket implementation).