input

fun input(block: () -> ByteArray): Output.Options.Builder(source)

Any input that needs to be passed to the process's stdin stream once it has spawned.

block is invoked once and only once. On Jvm/Native, if the process fails to spawn then block is never invoked. On Js there is no way to lazily provide the input, so it is always invoked before spawning the process.

NOTE: After being written to stdin, the array produced by block is zeroed out before the reference is dropped.

NOTE: block will be called from the same thread that Process.Builder.output is called from.

Declaring this will override any Process.Builder.stdin configuration if it is set to something other than Stdio.Pipe.