class TlsStream
source · line 14public class TlsStream internal constructor(private val pump: SyncPump, private val owner: Closeable) : ByteSource, ByteSink, Closeable
- Supertype
ByteSource - Supertype
ByteSink - Supertype
Closeable - Inherited
fun dispose(): Unit· Closeable
A synchronous TLS byte stream that owns its transport and native TLS state. Construction completes the handshake. Operations must not overlap.
close releases local resources; shutdownGracefully exchanges TLS close notifications before closing the transport. A failed I/O operation closes owned resources.
property connectionInfo
source · line 47public val connectionInfo: TlsConnectionInfo
get: public read-only
The negotiated version and ALPN. Reading this property requires an open, idle stream.
getter get
source · line 47get(): TlsConnectionInfo
function close
source · line 135public override fun close(): Unit
- Overrides
close
Closes the owned transport and releases local state without performing a TLS close handshake. It rejects an overlapping stream operation.
function writeFrom
source · line 71public override fun writeFrom(buffer: NativeByteBuffer, count: Long): Long
- Overrides
writeFrom
Writes readable plaintext and advances the buffer by the accepted count. A call may accept only a prefix, at most 16,384 bytes.
parameter count
source · line 71count: Long
parameter buffer
source · line 71buffer: NativeByteBuffer
function flush
source · line 92public override fun flush(): Unit
- Overrides
flush
Drains pending TLS ciphertext and flushes the underlying byte sink.
function readInto
source · line 66public override fun readInto(buffer: NativeByteBuffer, count: Long): Long
- Overrides
readInto
Reads decrypted bytes into writable buffer space and advances the buffer by the returned count. A zero count request performs no transfer.
parameter buffer
source · line 66buffer: NativeByteBuffer
parameter count
source · line 66count: Long
function shutdownGracefully
source · line 104public fun shutdownGracefully(): Unit
Completes the TLS close handshake, then closes the owned transport and local state. Use this when the peer must receive an orderly TLS shutdown.
property isClosed
source · line 43public val isClosed: Boolean
get: public read-only
Whether local transport, engine, and buffer cleanup has begun.
getter get
source · line 43get(): Boolean