ConsoleInputStream
classin packageklyn.io
public class ConsoleInputStream implements InputStream
ConsoleInputStream
All Implemented Interfaces: InputStream

Borrowed binary view of the calling process's standard input. Reads return an available prefix, not necessarily the requested length; zero means end-of-input. No terminal echo or line discipline is changed. ConsoleTextReader shares the same native input buffer, so text read-ahead is retained when switching to binary reads. close() leaves input open.

Example
input = ConsoleInputStream()
buffer = Byte[4096]
count = input.readInto(buffer)
Constructors
Modifier and Type Member Description
public ConsoleInputStream Creates a borrowed standard-input view without opening another handle.
Methods
Modifier and Type Member Description
public close
close() as Void
Leaves standard input open; this borrowed view remains usable.
public read
read() as String
Reads through EOF as strict UTF-8, preserving embedded U+0000 scalars.
public readBytes
readBytes(length as Long) as Byte[]
Reads one available prefix into a new array; does not wait to fill it.
public readInto
readInto(notnull buffer as Byte[], offset as Long = 0l, length as Long = -1l) as Long
Reads raw bytes into an existing buffer.
Inherited Methods
methodInherited Methods from InputStream: read, readBytes
methodInherited Methods from AutoClosable: close