| 11854 | */ |
| 11855 | template<typename NumberType> |
| 11856 | bool get_binary(const input_format_t format, |
| 11857 | const NumberType len, |
| 11858 | binary_t& result) |
| 11859 | { |
| 11860 | bool success = true; |
| 11861 | for (NumberType i = 0; i < len; i++) |
| 11862 | { |
| 11863 | get(); |
| 11864 | if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "binary"))) |
| 11865 | { |
| 11866 | success = false; |
| 11867 | break; |
| 11868 | } |
| 11869 | result.push_back(static_cast<std::uint8_t>(current)); |
| 11870 | } |
| 11871 | return success; |
| 11872 | } |
| 11873 | |
| 11874 | /*! |
| 11875 | @param[in] format the current format (for diagnostics) |