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
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Members list
Value members
Abstract methods
Writes CSV to destination OutputStream
.
Writes CSV to destination OutputStream
.
Value parameters
- codec
-
codec used to convert bytes to characters, with default JVM charset as fallback
- fos
-
input stream containing CSV content, wrapped in effect F to defer its creation
Attributes
- Returns
-
pipe converting stream of characters to empty one
- Note
-
This function does not close the output stream after use, which is different from default behavior of
fs2-io
functions takingOutputStream
as parameter.
Writes CSV to destination OutputStream
.
Writes CSV to destination OutputStream
.
Value parameters
- codec
-
codec used to convert bytes to characters, with default JVM charset as fallback
- os
-
input stream containing CSV content
Attributes
- Returns
-
pipe converting stream of characters to empty one
- Note
-
This function does not close the output stream after use, which is different from default behavior of
fs2-io
functions takingOutputStream
as parameter.
Writes CSV to target path.
Writes CSV to target path.
Value parameters
- codec
-
codec used to convert bytes to characters, with default JVM charset as fallback
- path
-
the path to target file
Attributes
- Returns
-
pipe converting stream of characters to empty one
- Example
-
given codec = new Codec(Charset.forName("UTF-8")) val path = Path.of("data.csv") val stream: Stream[IO, Char] = ??? val handler: Stream[IO, Unit] = stream.through(Writer[IO].write(path))