| 298 | } |
| 299 | |
| 300 | inline bool ReadWriteUtil::SkipBytes(uint8_t** buf, int* buf_len, int num_bytes, |
| 301 | Status* status) { |
| 302 | DCHECK_GE(*buf_len, 0); |
| 303 | if (UNLIKELY(num_bytes > *buf_len)) { |
| 304 | std::stringstream ss; |
| 305 | ss << "Cannot skip " << num_bytes << " bytes, buffer length is " << *buf_len; |
| 306 | *status = Status(ss.str()); |
| 307 | return false; |
| 308 | } |
| 309 | *buf += num_bytes; |
| 310 | *buf_len -= num_bytes; |
| 311 | return true; |
| 312 | } |
| 313 | |
| 314 | inline bool ReadWriteUtil::IsNegativeVInt(int8_t byte) { |
| 315 | return byte < -120 || (byte >= -112 && byte < 0); |
no test coverage detected