CapturingOutputStream

class CapturingOutputStream(parentStream: PrintStream?, conf: OutputConfig, captureOutput: Boolean, val onCaptured: (String) -> Unit) : OutputStream

An OutputStream that captures the written content while optionally forwarding it to a parentStream. Capturing only happens if captureOutput is true. The captured content is passed to a callback function onCaptured when certain buffer conditions are met. These conditions are defined by conf.

Constructors

Link copied to clipboard
constructor(parentStream: PrintStream?, conf: OutputConfig, captureOutput: Boolean, onCaptured: (String) -> Unit)

Properties

Link copied to clipboard
@get:TestOnly
val contents: ByteArray
Link copied to clipboard

A callback function called with the captured content.

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun flush()
Link copied to clipboard
open fun write(p0: ByteArray)
open fun write(p0: ByteArray, p1: Int, p2: Int)
open override fun write(b: Int)