| 12010 | */ |
| 12011 | template<typename NumberType> |
| 12012 | bool get_binary(const input_format_t format, |
| 12013 | const NumberType len, |
| 12014 | binary_t& result) |
| 12015 | { |
| 12016 | bool success = true; |
| 12017 | for (NumberType i = 0; i < len; i++) |
| 12018 | { |
| 12019 | get(); |
| 12020 | if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "binary"))) |
| 12021 | { |
| 12022 | success = false; |
| 12023 | break; |
| 12024 | } |
| 12025 | result.push_back(static_cast<std::uint8_t>(current)); |
| 12026 | } |
| 12027 | return success; |
| 12028 | } |
| 12029 | |
| 12030 | /*! |
| 12031 | @param[in] format the current format (for diagnostics) |