Plain

info.fingo.spata.io.Reader$.Plain
final class Plain[F[_]] extends Reader[F]

Reader which executes I/O operations on current thread, without context (thread) shifting.

Type parameters

F

the effect type, with type class providing support for delayed execution (typically cats.effect.IO) and logging (provided internally by spata)

Value parameters

chunkSize

size of data chunk

Attributes

Graph
Supertypes
trait Reader[F]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def read(source: Source): Stream[F, Char]

Reads a CSV source and returns a stream of character.

Reads a CSV source and returns a stream of character.

The caller of this function is responsible for proper resource acquisition and release. This may be done with fs2.Stream.bracket.

Character encoding has to be handled while creating scala.io.Source.

Attributes

def read(fis: F[InputStream])(using codec: Codec): Stream[F, Char]

Reads a CSV source and returns a stream of character.

Reads a CSV source and returns a stream of character.

Attributes

def read(is: InputStream)(using codec: Codec): Stream[F, Char]

Reads a CSV source and returns a stream of character.

Reads a CSV source and returns a stream of character.

Attributes

def read(path: Path)(using codec: Codec): Stream[F, Char]

Reads a CSV file and returns a stream of character.

Reads a CSV file and returns a stream of character.

Attributes

Inherited methods

def apply(fis: F[InputStream])(using codec: Codec): Stream[F, Char]

Alias for read.

Alias for read.

Value parameters

codec

codec used to convert bytes to characters, with default JVM charset as fallback

fis

input stream containing CSV content, wrapped in effect F to defer its creation

Attributes

Returns

the stream of characters

Inherited from:
Reader
def apply[A : CSV](csv: A)(implicit evidence$1: CSV[A], codec: Codec): Stream[F, Char]

Alias for various read methods.

Alias for various read methods.

Type parameters

A

type of source

Value parameters

codec

codec used to convert bytes to characters, with default JVM charset as fallback

csv

the CSV data

Attributes

Returns

the stream of characters

Inherited from:
Reader
def by[A : CSV](implicit evidence$2: CSV[A], codec: Codec): (F, A) => Char

Pipe converting stream with CSV source to stream of characters.

Pipe converting stream with CSV source to stream of characters.

Type parameters

A

type of source

Value parameters

codec

codec used to convert bytes to characters, with default JVM charset as fallback

Attributes

Returns

a pipe to converter CSV source into scala.Chars

Example
val stream = Stream
 .bracket(IO(Source.fromFile("input.csv")))(source => IO(source.close()))
 .through(Reader[IO].by)
Inherited from:
Reader

Concrete fields

override val chunkSize: Int

Size of data chunk loaded at once when reading from source. See also FS2 Chunks.

Size of data chunk loaded at once when reading from source. See also FS2 Chunks.

Attributes