WriteCursor

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.

Companion
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def seek(position: Long): WriteCursor[F]

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

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

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.

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.

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]].

Inherited methods

def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product