source

fun InputStream.source(): Source

Returns a source that reads from in.

fun Socket.source(): Source

Returns a source that reads from socket. Prefer this over source because this method honors timeouts. When the socket read times out, the socket is asynchronously closed by a watchdog thread.

fun File.source(): Source

Returns a source that reads from file.

@IgnoreJRERequirement()
fun Path.source(vararg options: OpenOption): Source

Returns a sink that writes to path.