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