1.50 <GMemoryInputStream>

Class: <GMemoryInputStream>

It derives from <GInputStream>.

<GMemoryInputStream> is a class for using arbitrary memory chunks as input for GIO streaming input operations.

As of GLib 2.34, <GMemoryInputStream> implements <GPollableInputStream>.

Fields

parent-instance

Procedures

Method: memory-input-stream:add-bytes self bytes
Method: add-bytes self bytes

Appends bytes to data that can be read from the input stream.

self

Passed: a <GMemoryInputStream>.

a <GMemoryInputStream>

bytes

Passed: a <GBytes>.

input data

Method: memory-input-stream:add-data self data [destroy]
Method: add-data self data [destroy]

Appends data to data that can be read from the input stream

self

Passed: a <GMemoryInputStream>.

a <GMemoryInputStream>

data

Passed: a bytevector, or a list or vector, each an unsigned 8-bit integer.

input data

destroy

Passed, or left out: a procedure, or #f.

function that is called to free data, or #f

See GDestroyNotify for how it is called.

len

Not passed: guile-gi gives the length of data.

length of the data, may be -1 if data is a nul-terminated string

Procedure: memory-input-stream:new ⇒ %return

Creates a new empty <GMemoryInputStream>.

%return

Returned: a <GInputStream>.

a new <GInputStream>

Procedure: memory-input-stream:new-from-bytes bytes ⇒ %return

Creates a new <GMemoryInputStream> with data from the given bytes.

bytes

Passed: a <GBytes>.

a <GBytes>

%return

Returned: a <GInputStream>.

new <GInputStream> read from bytes

Procedure: memory-input-stream:new-from-data data [destroy] ⇒ %return

Creates a new <GMemoryInputStream> with data in memory of a given size.

data

Passed: a bytevector, or a list or vector, each an unsigned 8-bit integer.

input data

destroy

Passed, or left out: a procedure, or #f.

function that is called to free data, or #f

See GDestroyNotify for how it is called.

%return

Returned: a <GInputStream>.

new <GInputStream> read from data of len bytes.

len

Not passed: guile-gi gives the length of data.

length of the data, may be -1 if data is a nul-terminated string