create

open fun create(data: Array<Byte>): DataSource
open fun create(data: ByteString): DataSource

Create a DataSource instance that reads from a byte array.

Return

a DataSink that will read the given byte array.

Parameters

data

a byte array. Must not be null.

Throws

on a null data argument.


open fun create(file: File): DataSource

Create a DataSource instance that reads from a byte array.

Return

a DataSink that will read the given file.

Parameters

file

a file which will be read. Must not be null.

Throws

on a null file argument.