Method Shuffler.Shuffle()->add_source()


Method add_source

void add_source(mixed source, int|void start, int|void length)
void add_source(mixed source, function(Shuffle, int:array(string)|zero) wrap_cb)
void add_source(array source)
void add_source(array source, function(Shuffle, int:array(string)|zero) wrap_cb)

Description

Add a new source to the list of data sources. The data from the sources will be sent in order.

If start and length are not specified, the whole source will be sent, if start but not length is specified, the whole source, excluding the first start bytes will be sent.

Currently supported sources

int

An ordinary 8-bit wide byte.

string

An ordinary 8-bit wide pike string.

System.Memory

An initialized instance of the System.Memory class.

Stdio.Buffer

A Stdio.Buffer object which will be called once with read_buffer() to acquire the data.

Stdio.File

Stdio.File instance pointing to a normal file.

Stdio.Stream

Stdio.File instance pointing to a stream of some kind (network socket, named pipe, stdin etc). Blocking or nonblocking.

Stdio.NonblockingStream|Stdio.Stream

An object implementing the callback based reading (set_read_callback and set_close_callback).

array

An array of any of the supported sources. Note that neither start nor length can be specified then.