WriteCursor

fs2.io.file.WriteCursor
See theWriteCursor companion object
final case class WriteCursor[F[_]](file: FileHandle[F], offset: Long)

Associates a FileHandle with an offset in to the file.

This encapsulates the pattern of incrementally writing bytes in to a file, a chunk at a time. Convenience methods are provided for working with pulls.

Attributes

Companion
object
Source
WriteCursor.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Returns a new cursor with the offset adjusted to the specified position.

Returns a new cursor with the offset adjusted to the specified position.

Attributes

Source
WriteCursor.scala
def write(bytes: Chunk[Byte])(implicit F: Monad[F]): F[WriteCursor[F]]

Writes a single chunk to the underlying file handle, returning a new cursor with an offset incremented by the chunk size.

Writes a single chunk to the underlying file handle, returning a new cursor with an offset incremented by the chunk size.

Attributes

Source
WriteCursor.scala
def writeAll(s: Stream[F, Byte]): Pull[F, Nothing, WriteCursor[F]]

Writes all chunks from the supplied stream to the underlying file handle, returning a cursor with offset incremented by the total number of bytes written.

Writes all chunks from the supplied stream to the underlying file handle, returning a cursor with offset incremented by the total number of bytes written.

Attributes

Source
WriteCursor.scala
def writePull(bytes: Chunk[Byte]): Pull[F, Nothing, WriteCursor[F]]

Like write but returns a pull instead of an F[WriteCursor[F]].

Like write but returns a pull instead of an F[WriteCursor[F]].

Attributes

Source
WriteCursor.scala

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product