#include <grpc/support/port_platform.h>
#include <stdint.h>
#include <string.h>
#include <grpc/byte_buffer.h>
#include <grpc/byte_buffer_reader.h>
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/slice.h>
#include <grpc/support/log.h>
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/slice/slice_refcount.h"
Go to the source code of this file.
void grpc_byte_buffer_reader_destroy | ( | grpc_byte_buffer_reader * | reader | ) |
Cleanup and destroy reader
Definition at line 45 of file byte_buffer_reader.cc.
int grpc_byte_buffer_reader_init | ( | grpc_byte_buffer_reader * | reader, |
grpc_byte_buffer * | buffer | ||
) |
Initialize reader to read over buffer. Returns 1 upon success, 0 otherwise.
Definition at line 33 of file byte_buffer_reader.cc.
int grpc_byte_buffer_reader_next | ( | grpc_byte_buffer_reader * | reader, |
grpc_slice * | slice | ||
) |
Updates slice with the next piece of data from from reader and returns
Definition at line 66 of file byte_buffer_reader.cc.
int grpc_byte_buffer_reader_peek | ( | grpc_byte_buffer_reader * | reader, |
grpc_slice ** | slice | ||
) |
EXPERIMENTAL API - This function may be removed and changed, in the future.
Updates slice with the next piece of data from from reader and returns
NOTE: Do not use this function unless the caller can guarantee that the underlying grpc_byte_buffer outlasts the use of the slice. This is only safe when the underlying grpc_byte_buffer remains immutable while slice is being accessed.
Definition at line 49 of file byte_buffer_reader.cc.
grpc_slice grpc_byte_buffer_reader_readall | ( | grpc_byte_buffer_reader * | reader | ) |
Merge all data from reader into single slice
Definition at line 84 of file byte_buffer_reader.cc.