xref: /freebsd/crypto/openssl/doc/man3/BIO_f_readbuffer.pod (revision 02e9120893770924227138ba49df1edb3896112a)
1=pod
2
3=head1 NAME
4
5BIO_f_readbuffer
6- read only buffering BIO that supports BIO_tell() and BIO_seek()
7
8=head1 SYNOPSIS
9
10 #include <openssl/bio.h>
11
12 const BIO_METHOD *BIO_f_readbuffer(void);
13
14=head1 DESCRIPTION
15
16BIO_f_readbuffer() returns the read buffering BIO method.
17
18This BIO filter can be inserted on top of BIO's that do not support BIO_tell()
19or BIO_seek() (e.g. A file BIO that uses stdin).
20
21Data read from a read buffering BIO comes from an internal buffer which is
22filled from the next BIO in the chain.
23
24BIO_gets() is supported for read buffering BIOs.
25Writing data to a read buffering BIO is not supported.
26
27Calling BIO_reset() on a read buffering BIO does not clear any buffered data.
28
29=head1 NOTES
30
31Read buffering BIOs implement BIO_read_ex() by using BIO_read_ex() operations
32on the next BIO (e.g. a file BIO) in the chain and storing the result in an
33internal buffer, from which bytes are given back to the caller as appropriate
34for the call. BIO_read_ex() is guaranteed to give the caller the number of bytes
35it asks for, unless there's an error or end of communication is reached in the
36next BIO. The internal buffer can grow to cache the entire contents of the next
37BIO in the chain. BIO_seek() uses the internal buffer, so that it can only seek
38into data that is already read.
39
40=head1 RETURN VALUES
41
42BIO_f_readbuffer() returns the read buffering BIO method.
43
44=head1 SEE ALSO
45
46L<bio(7)>,
47L<BIO_read(3)>,
48L<BIO_gets(3)>,
49L<BIO_reset(3)>,
50L<BIO_ctrl(3)>.
51
52=head1 COPYRIGHT
53
54Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
55
56Licensed under the Apache License 2.0 (the "License").  You may not use
57this file except in compliance with the License.  You can obtain a copy
58in the file LICENSE in the source distribution or at
59L<https://www.openssl.org/source/license.html>.
60
61=cut
62