public interface InputStream extends AutoClosable:
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()| Modifier and Type | Member | Description |
|---|---|---|
| public | readread() as String throws IOException |
Reads the remaining data as text. |
| public | readBytesreadBytes(length as Int) as Array<Byte> throws IOException |
Reads up to `length` bytes from the stream. |