Method _Stdio.Buffer()->consume()

class _Stdio.Buffer

Method consume

int(0..)|int(-1) consume(int n, bool|void absolute)

Description

Discard the first n bytes from the buffer.

Parameter n

Number of bytes relative to the current read position.

Parameter absolute

If 1 n is relative to the absolute buffer start (ie it will adjust the read position so that unread(0) will return n).

Returns -1 on error and the amount of space still left otherwise.

Note

Prior to Pike 9.0, this function supported neither negative n nor the absolute argument.

See also

unread()