| 75 | } |
| 76 | |
| 77 | bool GrpcByteBufferSource::Skip(int count) { |
| 78 | const void* data; |
| 79 | int size; |
| 80 | while (Next(&data, &size)) { |
| 81 | if (size >= count) { |
| 82 | BackUp(size - count); |
| 83 | return true; |
| 84 | } |
| 85 | // size < count; |
| 86 | count -= size; |
| 87 | } |
| 88 | // error or we have too large count; |
| 89 | return false; |
| 90 | } |
| 91 | |
| 92 | ::grpc::protobuf::int64 GrpcByteBufferSource::ByteCount() const { |
| 93 | return byte_count_; |