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
.
Attributes
Members list
Type members
Classlikes
Representation of CSV data destination, used to witness that certain sources may be used by write operations.
Representation of CSV data destination, used to witness that certain sources may be used by write operations.
Attributes
- See also
-
CSV object.
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object outputStreamWitness.typeobject pathWitness.type
Writer which executes I/O operations on current thread, without context (thread) shifting.
Writer 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)
Attributes
- Supertypes
Writer which shifts I/O operations to a thread pool provided for blocking operations. Uses the built-in internal blocking thread pool.
Writer 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).
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).
Attributes
- Returns
-
Writer
with support for thread shifting
Provides basic writer executing I/O on current thread.
Provides basic writer 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)
Attributes
- Returns
-
basic
Writer
Provides writer with support of context (thread) shifting for I/O operations. Uses the built-in internal blocking thread pool and default chunks size.
Provides writer 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
-
Writer
with support for thread shifting