SourceCompanionIOOps

ox.channels.SourceCompanionIOOps

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Source

Members list

Value members

Concrete methods

def fromFile(path: Path, chunkSize: Int)(using Ox, StageCapacity): Source[Chunk[Byte]]

Creates a Source that emits byte chunks read from a file. Implicit StageCapacity can be used to control the number of buffered chunks.

Creates a Source that emits byte chunks read from a file. Implicit StageCapacity can be used to control the number of buffered chunks.

Value parameters

chunkSize

maximum number of bytes to read from the file before emitting a new chunk.

path

path the file to read from.

Attributes

Returns

a Source of chunks of bytes.

Throws
IOException

If an I/O error occurs when opening the file.

SecurityException

If SecurityManager error occurs when opening the file.

def fromInputStream(is: InputStream, chunkSize: Int)(using Ox, StageCapacity): Source[Chunk[Byte]]

Converts a java.io.InputStream into a Source[Chunk[Bytes]]. Implicit StageCapacity can be used to control the number of buffered chunks.

Converts a java.io.InputStream into a Source[Chunk[Bytes]]. Implicit StageCapacity can be used to control the number of buffered chunks.

Value parameters

chunkSize

maximum number of bytes to read from the underlying InputStream before emitting a new chunk.

is

an InputStream to read bytes from.

Attributes

Returns

a Source of chunks of bytes.