SourceIOOps

ox.channels.SourceIOOps
trait SourceIOOps[+T]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Source[T]
class Channel[T]
Self type
Source[T]

Members list

Value members

Concrete methods

def asInputStream(using T <:< Chunk[Byte]): InputStream

Creates a java.io.InputStream out of this Source. The InputStream can read bytes from the underlying channel.

Creates a java.io.InputStream out of this Source. The InputStream can read bytes from the underlying channel.

Attributes

def toFile(path: Path)(using T <:< Chunk[Byte], IO): Unit

Writes content of this Source to a file.

Writes content of this Source to a file.

Value parameters

path

Path to the target file. If not exists, it will be created.

Attributes

Throws
IOException

if an error occurs when opening the file or during the write process.

def toOutputStream(outputStream: OutputStream)(using T <:< Chunk[Byte], IO): Unit

Writes content of this Source to an java.io.OutputStream.

Writes content of this Source to an java.io.OutputStream.

Value parameters

outputStream

Target OutputStream to write to. Will be closed after finishing the process or on error.

Attributes

Throws
IOException

if an error occurs when writing or closing of the OutputStream.