NioSinks

zio.blocks.streams.NioSinks
object NioSinks

JVM-only convenience constructors for creating Sink instances that write to NIO ByteBuffers and WritableByteChannels.

Each method creates a sink that drains the stream into the corresponding NIO target.

Attributes

Source
NioSinks.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
NioSinks.type

Members list

Value members

Concrete methods

def fromByteBuffer(buf: ByteBuffer): Sink[Nothing, Byte, Unit]

Creates a sink that writes all stream bytes into a ByteBuffer. Throws BufferOverflowException if the buffer has insufficient remaining capacity.

Creates a sink that writes all stream bytes into a ByteBuffer. Throws BufferOverflowException if the buffer has insufficient remaining capacity.

Attributes

Source
NioSinks.scala
def fromByteBufferDouble(buf: ByteBuffer): Sink[Nothing, Double, Unit]

Creates a sink that writes all stream Doubles into a ByteBuffer (8 bytes per element). Throws BufferOverflowException if the buffer has insufficient remaining capacity.

Creates a sink that writes all stream Doubles into a ByteBuffer (8 bytes per element). Throws BufferOverflowException if the buffer has insufficient remaining capacity.

Attributes

Source
NioSinks.scala
def fromByteBufferFloat(buf: ByteBuffer): Sink[Nothing, Float, Unit]

Creates a sink that writes all stream Floats into a ByteBuffer (4 bytes per element). Throws BufferOverflowException if the buffer has insufficient remaining capacity.

Creates a sink that writes all stream Floats into a ByteBuffer (4 bytes per element). Throws BufferOverflowException if the buffer has insufficient remaining capacity.

Attributes

Source
NioSinks.scala
def fromByteBufferInt(buf: ByteBuffer): Sink[Nothing, Int, Unit]

Creates a sink that writes all stream Ints into a ByteBuffer (4 bytes per element). Throws BufferOverflowException if the buffer has insufficient remaining capacity.

Creates a sink that writes all stream Ints into a ByteBuffer (4 bytes per element). Throws BufferOverflowException if the buffer has insufficient remaining capacity.

Attributes

Source
NioSinks.scala
def fromByteBufferLong(buf: ByteBuffer): Sink[Nothing, Long, Unit]

Creates a sink that writes all stream Longs into a ByteBuffer (8 bytes per element). Throws BufferOverflowException if the buffer has insufficient remaining capacity.

Creates a sink that writes all stream Longs into a ByteBuffer (8 bytes per element). Throws BufferOverflowException if the buffer has insufficient remaining capacity.

Attributes

Source
NioSinks.scala
def fromChannel(ch: WritableByteChannel, bufSize: Int = ...): Sink[IOException, Byte, Unit]

A sink that writes all stream bytes to a java.nio.channels.WritableByteChannel with internal buffering. Does not close the channel.

A sink that writes all stream bytes to a java.nio.channels.WritableByteChannel with internal buffering. Does not close the channel.

Value parameters

bufSize

Internal buffer size in bytes (default 8192).

ch

The channel to write to.

Attributes

Source
NioSinks.scala