NioStreams

zio.blocks.streams.NioStreams
object NioStreams

JVM-only convenience constructors for creating Stream instances backed by NIO ByteBuffers and ReadableByteChannels.

Each method wraps an NIO source as a Stream.

Attributes

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

Members list

Value members

Concrete methods

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

Creates a stream of bytes from a ByteBuffer.

Creates a stream of bytes from a ByteBuffer.

Attributes

Source
NioStreams.scala
def fromByteBufferDouble(buf: ByteBuffer): Stream[Nothing, Double]

Creates a stream of Doubles from a ByteBuffer (8 bytes per element).

Creates a stream of Doubles from a ByteBuffer (8 bytes per element).

Attributes

Source
NioStreams.scala
def fromByteBufferFloat(buf: ByteBuffer): Stream[Nothing, Float]

Creates a stream of Floats from a ByteBuffer (4 bytes per element).

Creates a stream of Floats from a ByteBuffer (4 bytes per element).

Attributes

Source
NioStreams.scala
def fromByteBufferInt(buf: ByteBuffer): Stream[Nothing, Int]

Creates a stream of Ints from a ByteBuffer (4 bytes per element).

Creates a stream of Ints from a ByteBuffer (4 bytes per element).

Attributes

Source
NioStreams.scala
def fromByteBufferLong(buf: ByteBuffer): Stream[Nothing, Long]

Creates a stream of Longs from a ByteBuffer (8 bytes per element).

Creates a stream of Longs from a ByteBuffer (8 bytes per element).

Attributes

Source
NioStreams.scala
def fromChannel(ch: ReadableByteChannel, bufSize: Int = ...): Stream[IOException, Byte]

Creates a buffered stream of bytes from a java.nio.channels.ReadableByteChannel. Closes the channel when done.

Creates a buffered stream of bytes from a java.nio.channels.ReadableByteChannel. Closes the channel when done.

Value parameters

bufSize

Internal buffer size in bytes (default 8192).

ch

The channel to read from.

Attributes

Source
NioStreams.scala
def fromChannelUnmanaged(ch: ReadableByteChannel, bufSize: Int = ...): Stream[IOException, Byte]

Creates a buffered stream of bytes from a java.nio.channels.ReadableByteChannel without managing its lifecycle. The caller is responsible for closing the channel.

Creates a buffered stream of bytes from a java.nio.channels.ReadableByteChannel without managing its lifecycle. The caller is responsible for closing the channel.

Value parameters

bufSize

Internal buffer size in bytes (default 8192).

ch

The channel to read from.

Attributes

Source
NioStreams.scala