aboutsummaryrefslogtreecommitdiffstats
path: root/pages/develop/api/efl/io/buffered_stream/method/discard.txt
blob: 973b65e5aa1fb287c61b89fb8e2be412ead8383f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
~~Title: Efl.Io.Buffered_Stream.discard~~
===== Signature =====

<code>
discard {
    params {
        @in amount: size;
    }
}
</code>

===== C signature =====

<code c>
void efl_io_buffered_stream_discard(Eo *obj, size_t amount);
</code>

===== Parameters =====

  * **amount** //(in)// - %%Bytes to discard%%

===== Description =====

%%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 %%[[:develop:api:efl:io:buffered_stream:property:slice|Efl.Io.Buffered_Stream.slice]]%%, if users read the information from the slice and once they're done, that data must be discarded.%%

%%As an example, some protocols provide messages with a "size" header, then %%[[:develop:api:efl:io:buffered_stream:property:slice|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, in this case the slice may be handled to some processing function. When the function is done, that amount of data must be discarded -- with this function.%%

//Since 1.19//
{{page>:develop:api-include:efl:io:buffered_stream:method:discard:description&nouser&nolink&nodate}}

===== Implemented by =====

  * **Efl.Io.Buffered_Stream.discard**