InputStream
interfacein packageklyn.io
public interface InputStream extends AutoClosable:
└ InputStream
Binary input stream contract. Concrete implementations expose a byte-oriented readable resource such as a file or a socket.
import klyn.io

stream as InputStream = FilePath("data.bin").openInputStream()
try:
chunk = stream.readBytes(16)
print(chunk.size)
finally:
stream.close()
Methods
Modifier and Type Member Description
public read
read() as String throws IOException
Reads the remaining data as text.
public readBytes
readBytes(length as Int) as Array<Byte> throws IOException
Reads up to `length` bytes from the stream.
Methods inherited from AutoClosable: close