info.fingo.spata.io
Members list
Type members
Classlikes
Reader interface with reading operations from various sources. The I/O operations are wrapped in effect F (e.g. cats.effect.IO), allowing deferred computation. The returned fs2.Stream allows further input processing in a very flexible, purely functional manner.
Reader interface with reading operations from various sources. The I/O operations are wrapped in effect F (e.g. cats.effect.IO), allowing deferred computation. The returned fs2.Stream allows further input processing in a very flexible, purely functional manner.
Processing I/O errors, manifested through java.io.IOException, should be handled with fs2.Stream.handleErrorWith. If not handled, they will propagate as exceptions.
Type parameters
- F
-
the effect type
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Utility to read external data and provide stream of characters. It is used through one of its inner classes:
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
Writer interface with writing operations to various destinations. The I/O operations are wrapped in effect F (e.g. cats.effect.IO), allowing deferred computation.
Writer interface with writing operations to various destinations. The I/O operations are wrapped in effect F (e.g. cats.effect.IO), allowing deferred computation.
Processing I/O errors, manifested through java.io.IOException, should be handled with fs2.Stream.handleErrorWith. If not handled, they will propagate as exceptions.
Type parameters
- F
-
the effect type
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Utility to write external data from a stream of characters. It is used through one of its inner classes:
Utility to write external data from a stream of characters. It is used through one of its inner classes:
- Writer.Plain for standard writing operations executed on current thread,
- Writer.Shifting to support context (thread) shifting for blocking operations (see Cats Effect thread model).
The writing functions in Writer.Shifting use fs2-io library.
In every case, the caller of function taking resource (java.io.OutputStream) as a parameter is responsible for its cleanup.
Functions writing binary data (to java.io.InputStream or taking java.nio.file.Path) use given scala.io.Codec to encode data. If not provided, the default JVM charset is used.
For data encoded to UTF, the byte order mark (BOM) is not added to the output.
All of above applies not only to write functions but also to apply, which internally make use of write.