ConsoleOutputStream
classin packageklyn.io
public class ConsoleOutputStream implements OutputStream
ConsoleOutputStream
All Implemented Interfaces: OutputStream

Borrowed binary view of process standard output or standard error. Bytes are written exactly, including NUL and LF, without text-mode newline conversion or changing the process-wide CRT mode. Writes complete the supplied range or report a failure; close() never closes the shared stream.

Example
output = ConsoleOutputStream()
try input = FilePath("payload.bin").openInputStream():
    output.writeBytes(input.readBytes(4096l))
Constructors
Modifier and Type Member Description
public ConsoleOutputStream
ConsoleOutputStream(standardError as Boolean = false)
Selects a process-owned output stream; does not duplicate its handle.
Methods
Modifier and Type Member Description
public close
close() as Void
Leaves the process-owned output open; this borrowed view remains usable.
public write
write(value as String) as Void
Encodes text as UTF-8 in bounded chunks, preserving embedded U+0000.
public writeBytes
writeBytes(value as Byte[]) as Void
Writes all supplied bytes; null is ignored.
public writeFrom
writeFrom(notnull buffer as Byte[], offset as Long = 0l, length as Long = -1l) as Void
Writes an existing byte-array range exactly, without copying it first.
Inherited Methods
methodInherited Methods from OutputStream: write, writeBytes
methodInherited Methods from AutoClosable: close