| 10811 | */ |
| 10812 | template<typename NumberType> |
| 10813 | bool get_binary(const input_format_t format, |
| 10814 | const NumberType len, |
| 10815 | binary_t& result) |
| 10816 | { |
| 10817 | bool success = true; |
| 10818 | for (NumberType i = 0; i < len; i++) |
| 10819 | { |
| 10820 | get(); |
| 10821 | if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "binary"))) |
| 10822 | { |
| 10823 | success = false; |
| 10824 | break; |
| 10825 | } |
| 10826 | result.push_back(static_cast<std::uint8_t>(current)); |
| 10827 | } |
| 10828 | return success; |
| 10829 | } |
| 10830 | |
| 10831 | /*! |
| 10832 | @param[in] format the current format (for diagnostics) |