GRPC Core  43.0.0
byte_buffer.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPC_BYTE_BUFFER_H
20 #define GRPC_BYTE_BUFFER_H
21 
22 #include <grpc/impl/grpc_types.h>
23 #include <grpc/slice_buffer.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
35  size_t nslices);
36 
44  grpc_slice* slices, size_t nslices, grpc_compression_algorithm compression);
45 
51 
54 
57 
61 
65  grpc_byte_buffer* buffer);
66 
69 
74  grpc_slice* slice);
75 
87  grpc_slice** slice);
88 
92 
95  grpc_byte_buffer_reader* reader);
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
101 #endif /* GRPC_BYTE_BUFFER_H */
GRPCAPI
#define GRPCAPI
Definition: port_platform.h:725
grpc_compression_algorithm
grpc_compression_algorithm
The various compression algorithms supported by gRPC (not sorted by compression level)
Definition: compression_types.h:60
grpc_raw_byte_buffer_from_reader
GRPCAPI grpc_byte_buffer * grpc_raw_byte_buffer_from_reader(grpc_byte_buffer_reader *reader)
Returns a RAW byte buffer instance from the output of reader.
grpc_raw_byte_buffer_create
GRPCAPI grpc_byte_buffer * grpc_raw_byte_buffer_create(grpc_slice *slices, size_t nslices)
Returns a RAW byte buffer instance over the given slices (up to nslices).
grpc_types.h
grpc_byte_buffer_reader_destroy
GRPCAPI void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader *reader)
Cleanup and destroy reader.
grpc_byte_buffer
Definition: grpc_types.h:42
grpc_slice
A grpc_slice s, if initialized, represents the byte range s.bytes[0..s.length-1].
Definition: slice_type.h:63
grpc_byte_buffer_copy
GRPCAPI grpc_byte_buffer * grpc_byte_buffer_copy(grpc_byte_buffer *bb)
Copies input byte buffer bb.
grpc_byte_buffer_reader_init
GRPCAPI int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader *reader, grpc_byte_buffer *buffer)
Initialize reader to read over buffer.
grpc_byte_buffer_length
GRPCAPI size_t grpc_byte_buffer_length(grpc_byte_buffer *bb)
Returns the size of the given byte buffer, in bytes.
grpc_byte_buffer_reader_peek
GRPCAPI 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.
slice_buffer.h
grpc_byte_buffer_reader_readall
GRPCAPI grpc_slice grpc_byte_buffer_reader_readall(grpc_byte_buffer_reader *reader)
Merge all data from reader into single slice.
grpc_byte_buffer_destroy
GRPCAPI void grpc_byte_buffer_destroy(grpc_byte_buffer *bb)
Destroys byte_buffer deallocating all its memory.
grpc_raw_compressed_byte_buffer_create
GRPCAPI grpc_byte_buffer * grpc_raw_compressed_byte_buffer_create(grpc_slice *slices, size_t nslices, grpc_compression_algorithm compression)
Returns a compressed RAW byte buffer instance over the given slices (up to nslices).
grpc_byte_buffer_reader
Definition: byte_buffer_reader.h:30
grpc_byte_buffer_reader_next
GRPCAPI 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.
port_platform.h