ZSinkPlatformSpecificConstructors

class Object
trait Matchable
class Any
object ZSink.type
ZSink.type

Value members

Concrete methods

def digest(createDigest: => MessageDigest): ZSink[Any, Nothing, Byte, Nothing, Chunk[Byte]]

Creates a sink which digests incoming bytes using Java's MessageDigest class, returning in a single byte chunk with the digest value once the stream completes.

Creates a sink which digests incoming bytes using Java's MessageDigest class, returning in a single byte chunk with the digest value once the stream completes.

Value parameters:
createDigest

A block that creates an empty MessageDirect, typically by invoking MessageDigest.getInstance with e.g. "SHA-1" or "SHA-256".

final def fromFile(path: => Path, position: Long, options: Set[OpenOption]): ZSink[Blocking, Throwable, Byte, Byte, Long]

Uses the provided Path to create a ZSink that consumes byte chunks and writes them to the File. The sink will yield count of bytes written.

Uses the provided Path to create a ZSink that consumes byte chunks and writes them to the File. The sink will yield count of bytes written.

final def fromOutputStream(os: OutputStream): ZSink[Blocking, IOException, Byte, Byte, Long]

Uses the provided OutputStream to create a ZSink that consumes byte chunks and writes them to the OutputStream. The sink will yield the count of bytes written.

Uses the provided OutputStream to create a ZSink that consumes byte chunks and writes them to the OutputStream. The sink will yield the count of bytes written.

The caller of this function is responsible for closing the OutputStream.

Uses the provided OutputStream resource to create a ZSink that consumes byte chunks and writes them to the OutputStream. The sink will yield the count of bytes written.

Uses the provided OutputStream resource to create a ZSink that consumes byte chunks and writes them to the OutputStream. The sink will yield the count of bytes written.

The OutputStream will be automatically closed after the stream is finished or an error occurred.