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