InterceptedStreams

The intercepted process output and error streams which can be read to capture inadvertent writes.

Functions

Link copied to clipboard
expect open override fun close()

Restore sending writes to the original output or error stream. Discards any unread data in the intercepted output and error streams.

actual open override fun close()
actual open override fun close()
Link copied to clipboard
expect fun interruptErrorRead()

Signal blocking calls to readError or readErrorWithTimeout to wake up and return 0.

actual fun interruptErrorRead()
actual fun interruptErrorRead()
Link copied to clipboard
expect fun interruptOutputRead()

Signal blocking calls to readOutput or readOutputWithTimeout to wake up and return 0.

actual fun interruptOutputRead()
actual fun interruptOutputRead()
Link copied to clipboard
expect fun readError(buffer: ByteArray, offset: Int, count: Int): Int

Read up to count bytes into buffer at offset from the intercepted error stream. The number of bytes read will be returned. 0 will be returned if interruptErrorRead is called while waiting for data.

actual fun readError(buffer: ByteArray, offset: Int, count: Int): Int
actual fun readError(buffer: ByteArray, offset: Int, count: Int): Int
Link copied to clipboard
expect fun readErrorWithTimeout(buffer: ByteArray, offset: Int, count: Int, timeoutMillis: Int): Int

Read up to count bytes into buffer at offset from the intercepted error stream. The number of bytes read will be returned. 0 will be returned if interruptErrorRead is called while waiting for data, or if at least timeoutMillis have passed without data.

actual fun readErrorWithTimeout(buffer: ByteArray, offset: Int, count: Int, timeoutMillis: Int): Int
actual fun readErrorWithTimeout(buffer: ByteArray, offset: Int, count: Int, timeoutMillis: Int): Int
Link copied to clipboard
expect fun readOutput(buffer: ByteArray, offset: Int, count: Int): Int

Read up to count bytes into buffer at offset from the intercepted output stream. The number of bytes read will be returned. 0 will be returned if interruptOutputRead is called while waiting for data.

actual fun readOutput(buffer: ByteArray, offset: Int, count: Int): Int
actual fun readOutput(buffer: ByteArray, offset: Int, count: Int): Int
Link copied to clipboard
expect fun readOutputWithTimeout(buffer: ByteArray, offset: Int, count: Int, timeoutMillis: Int): Int

Read up to count bytes into buffer at offset from the intercepted output stream. The number of bytes read will be returned. 0 will be returned if interruptOutputRead is called while waiting for data, or if at least timeoutMillis have passed without data.

actual fun readOutputWithTimeout(buffer: ByteArray, offset: Int, count: Int, timeoutMillis: Int): Int
actual fun readOutputWithTimeout(buffer: ByteArray, offset: Int, count: Int, timeoutMillis: Int): Int