Return a pointer to len bytes at the current read position and advance read pos
| 972 | |
| 973 | // Return a pointer to len bytes at the current read position and advance read pos |
| 974 | const uint8_t* consume(unsigned int len) { |
| 975 | if (rptr == end && len != 0) |
| 976 | throw end_of_stream(); |
| 977 | const uint8_t* p = rptr; |
| 978 | rptr += len; |
| 979 | if (rptr > end) |
| 980 | throw failure_error; |
| 981 | return p; |
| 982 | } |
| 983 | |
| 984 | // Return a T from the current read position and advance read pos |
| 985 | template <typename T> |