Reader

trait Reader[t: Type]Source

A trait for types which are resources that can be accessed as bytes.

Instances

instance Reader[File]Source

Signatures

def read(b: Array[Int8, r], r: t): Result[IOError, Int32] \ r + IO with Reader[t] Source

Reads k bytes from the underlying resource and writes them into b.

Returns Ok(k) to signify that k bytes was successfully read and written to b.

Guarantees that 0 <= k < length(b).

Returns Err(e) if some underlying I/O error occurs.