Discards the given number of bytes.

This has the same effect as reading and discarding the given amount of bytes, without executing the actual copy.

It's often paired with Efl.Io.Buffered_Stream.slice. If users read the information from the slice, once they're done that data must be discarded.

By way of example, some protocols provide messages with a "size" header. In that case Efl.Io.Buffered_Stream.slice is used to peek into the available memory to see if there is a "size" and if the rest of the slice is the full payload. Here the slice may be handled by a processing function. When the function is complete, that amount of data must be discarded -- by this function.

Since 1.19


discard {
    params {
        @in amount: size;

C signature

void efl_io_buffered_stream_discard(Eo *obj, size_t amount);


  • amount (in) - Bytes to discard

Implemented by

  • Efl.Io.Buffered_Stream.discard