#include <stdbool.h>
#include <stddef.h>
Go to the source code of this file.
Function Documentation
Consume (delete, invalidate) a part of the buffer.
The "nbytes" parameter must not be larger than the length returned by decoder_buffer_read().
- Parameters:
-
| buffer | the decoder_buffer object |
| nbytes | the number of bytes to consume |
Read data from the input_stream and append it to the buffer.
- Returns:
- true if data was appended; false if there is no data available (yet), end of file, I/O error or a decoder command was received
Frees resources used by the decoder_buffer object.
Creates a new buffer.
- Parameters:
-
| decoder | the decoder object, used for decoder_read(), may be NULL |
| is | the input stream object where we should read from |
| size | the maximum size of the buffer |
- Returns:
- the new decoder_buffer object
Reads data from the buffer.
This data is not yet consumed, you have to call decoder_buffer_consume() to do that. The returned buffer becomes invalid after a decoder_buffer_fill() or a decoder_buffer_consume() call.
- Parameters:
-
| buffer | the decoder_buffer object |
| length_r | pointer to a size_t where you will receive the number of bytes available |
- Returns:
- a pointer to the read buffer, or NULL if there is no data available
Skips the specified number of bytes, discarding its data.
- Parameters:
-
| buffer | the decoder_buffer object |
| nbytes | the number of bytes to skip |
- Returns:
- true on success, false on error