| 11936 | */ |
| 11937 | template<typename NumberType> |
| 11938 | bool get_binary(const input_format_t format, |
| 11939 | const NumberType len, |
| 11940 | binary_t& result) |
| 11941 | { |
| 11942 | bool success = true; |
| 11943 | for (NumberType i = 0; i < len; i++) |
| 11944 | { |
| 11945 | get(); |
| 11946 | if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "binary"))) |
| 11947 | { |
| 11948 | success = false; |
| 11949 | break; |
| 11950 | } |
| 11951 | result.push_back(static_cast<std::uint8_t>(current)); |
| 11952 | } |
| 11953 | return success; |
| 11954 | } |
| 11955 | |
| 11956 | /*! |
| 11957 | @param[in] format the current format (for diagnostics) |