| 36 | GrpcByteBufferSource::GrpcByteBufferSource() {} |
| 37 | |
| 38 | bool GrpcByteBufferSource::Init(const grpc::ByteBuffer& src) { |
| 39 | cur_ = -1; |
| 40 | left_ = 0; |
| 41 | ptr_ = nullptr; |
| 42 | byte_count_ = 0; |
| 43 | bool ok = src.Dump(&slices_).ok(); |
| 44 | if (!ok) { |
| 45 | slices_.clear(); |
| 46 | } |
| 47 | return ok; |
| 48 | } |
| 49 | |
| 50 | bool GrpcByteBufferSource::Next(const void** data, int* size) { |
| 51 | // Use loop instead of if in case buffer contained empty slices. |
no test coverage detected