Utility to read external data and provide stream of characters. It is used through one of its inner classes:
- Reader.Plain for standard reading operations executed on current thread,
- Reader.Shifting to support context (thread) shifting for blocking operations (see Cats Effect thread model).
The reading functions in Reader.Shifting, except the one reading from scala.io.Source, use fs2-io library.
In every case, the caller of function taking resource (scala.io.Source or java.io.InputStream
) as a parameter is responsible for its cleanup.
Functions reading binary data (from java.io.InputStream
or taking java.nio.file.Path
) use given scala.io.Codec to decode input data. If not provided, the default JVM charset is used.
For input data encoded in UTF
, the byte order mark (BOM
) is removed automatically. This is done even for functions reading from already decoded scala.io.Source as long as the given instance of scala.io.Codec with UTF
charset is provided.
All of above applies not only to read
functions but also to apply
and by
, which internally make use of read
.
Attributes
Members list
Type members
Classlikes
Representation of CSV data source, used to witness that certain sources may be used by read operations.
Representation of CSV data source, used to witness that certain sources may be used by read operations.
Attributes
Reader which executes I/O operations on current thread, without context (thread) shifting.
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
- Supertypes
Reader which shifts I/O operations to a thread pool provided for blocking operations. Uses the built-in internal blocking thread pool.
Reader which shifts I/O operations to a thread pool provided for blocking operations. Uses the built-in internal blocking thread pool.
Type parameters
- F
-
the effect type, with type classes providing support for suspended execution (typically cats.effect.IO),
Async
execution environment with blocking and non-blocking thread pools (to shift back and forth) and logging (provided internally by spata).
Value parameters
- chunkSize
-
size of data chunk
Attributes
- Supertypes
Value members
Concrete methods
Alias for shifting.
Alias for shifting.
Type parameters
- F
-
the effect type, with type classes providing support for suspended execution (typically cats.effect.IO),
Async
execution environment with blocking and non-blocking thread pools (to shift back and forth) and logging (provided internally by spata).
Value parameters
- chunkSize
-
size of data chunk - see FS2 Chunks.
Attributes
- Returns
-
Reader
with support for thread shifting
Alias for shifting.
Alias for shifting.
Type parameters
- F
-
the effect type, with type classes providing support for suspended execution (typically cats.effect.IO),
Async
execution environment with blocking and non-blocking thread pools (to shift back and forth) and logging (provided internally by spata).
Attributes
- Returns
-
Reader
with support for thread shifting
Provides basic reader executing I/O on current thread.
Provides basic reader executing I/O on current thread.
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
- Returns
-
basic
Reader
Provides basic reader executing I/O on current thread. Uses default chunk size.
Provides basic reader executing I/O on current thread. Uses default chunk size.
Type parameters
- F
-
the effect type, with type class providing support for delayed execution (typically cats.effect.IO) and logging (provided internally by spata)
Attributes
- Returns
-
basic
Reader
Provides reader with support of context (thread) shifting for I/O operations. Uses the built-in internal blocking thread pool.
Provides reader with support of context (thread) shifting for I/O operations. Uses the built-in internal blocking thread pool.
Type parameters
- F
-
the effect type, with type classes providing support for suspended execution (typically cats.effect.IO),
Async
execution environment with blocking and non-blocking thread pools (to shift back and forth) and logging (provided internally by spata).
Value parameters
- chunkSize
-
size of data chunk
Attributes
- Returns
-
Reader
with support for thread shifting
Provides reader with support of context (thread) shifting for I/O operations. Uses the built-in internal blocking thread pool and default chunks size.
Provides reader with support of context (thread) shifting for I/O operations. Uses the built-in internal blocking thread pool and default chunks size.
Type parameters
- F
-
the effect type, with type classes providing support for suspended execution (typically cats.effect.IO),
Async
execution environment with blocking and non-blocking thread pools (to shift back and forth) and logging (provided internally by spata).
Attributes
- Returns
-
Reader
with support for thread shifting