| 12037 | */ |
| 12038 | template<typename NumberType> |
| 12039 | bool get_binary(const input_format_t format, |
| 12040 | const NumberType len, |
| 12041 | binary_t& result) |
| 12042 | { |
| 12043 | bool success = true; |
| 12044 | for (NumberType i = 0; i < len; i++) |
| 12045 | { |
| 12046 | get(); |
| 12047 | if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "binary"))) |
| 12048 | { |
| 12049 | success = false; |
| 12050 | break; |
| 12051 | } |
| 12052 | result.push_back(static_cast<std::uint8_t>(current)); |
| 12053 | } |
| 12054 | return success; |
| 12055 | } |
| 12056 | |
| 12057 | /*! |
| 12058 | @param[in] format the current format (for diagnostics) |