| 12695 | */ |
| 12696 | template<typename NumberType> |
| 12697 | bool get_binary(const input_format_t format, |
| 12698 | const NumberType len, |
| 12699 | binary_t& result) |
| 12700 | { |
| 12701 | bool success = true; |
| 12702 | for (NumberType i = 0; i < len; i++) |
| 12703 | { |
| 12704 | get(); |
| 12705 | if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "binary"))) |
| 12706 | { |
| 12707 | success = false; |
| 12708 | break; |
| 12709 | } |
| 12710 | result.push_back(static_cast<std::uint8_t>(current)); |
| 12711 | } |
| 12712 | return success; |
| 12713 | } |
| 12714 | |
| 12715 | /*! |
| 12716 | @param[in] format the current format (for diagnostics) |