| 10067 | */ |
| 10068 | template<typename NumberType> |
| 10069 | bool get_binary(const input_format_t format, |
| 10070 | const NumberType len, |
| 10071 | binary_t& result) |
| 10072 | { |
| 10073 | bool success = true; |
| 10074 | for (NumberType i = 0; i < len; i++) |
| 10075 | { |
| 10076 | get(); |
| 10077 | if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "binary"))) |
| 10078 | { |
| 10079 | success = false; |
| 10080 | break; |
| 10081 | } |
| 10082 | result.push_back(static_cast<std::uint8_t>(current)); |
| 10083 | } |
| 10084 | return success; |
| 10085 | } |
| 10086 | |
| 10087 | /*! |
| 10088 | @param[in] format the current format (for diagnostics) |