| 9998 | */ |
| 9999 | template<typename NumberType> |
| 10000 | bool get_binary(const input_format_t format, |
| 10001 | const NumberType len, |
| 10002 | binary_t& result) |
| 10003 | { |
| 10004 | bool success = true; |
| 10005 | for (NumberType i = 0; i < len; i++) |
| 10006 | { |
| 10007 | get(); |
| 10008 | if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "binary"))) |
| 10009 | { |
| 10010 | success = false; |
| 10011 | break; |
| 10012 | } |
| 10013 | result.push_back(static_cast<std::uint8_t>(current)); |
| 10014 | } |
| 10015 | return success; |
| 10016 | } |
| 10017 | |
| 10018 | /*! |
| 10019 | @param[in] format the current format (for diagnostics) |