SocketInputStream
classin packageklyn.net
public class SocketInputStream implements InputStream:
SocketInputStream
All Implemented Interfaces: InputStream
Binary input stream wrapper for `Socket`.
import klyn.net

socket = Socket("example.com", 80)
try stream = socket.getInputStream():
print(stream.readBytes(8).size)
Methods
Modifier and Type Member Description
public close
close() as Void throws IOException:
No summary.
public read
read() as String throws IOException:
Reads a text chunk from the socket.
public readBytes
readBytes(length as Int) as Array<Byte> throws IOException:
Reads bytes from the socket.
Methods inherited from InputStream: read, readBytes
Methods inherited from AutoClosable: close