From 27700e06fd917e51a9251c3cebb31faf2e466a19 Mon Sep 17 00:00:00 2001 From: Daniel Parker Date: Mon, 25 Sep 2023 12:24:39 -0400 Subject: [PATCH] Fixed issue with UBJSON encode of json byte array --- include/jsoncons_ext/ubjson/ubjson_encoder.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/jsoncons_ext/ubjson/ubjson_encoder.hpp b/include/jsoncons_ext/ubjson/ubjson_encoder.hpp index ee4357f9f6..fdcbad78d9 100644 --- a/include/jsoncons_ext/ubjson/ubjson_encoder.hpp +++ b/include/jsoncons_ext/ubjson/ubjson_encoder.hpp @@ -334,8 +334,9 @@ class basic_ubjson_encoder final : public basic_json_visitor const size_t length = b.size(); sink_.push_back(jsoncons::ubjson::ubjson_type::start_array_marker); - binary::native_to_big(static_cast(jsoncons::ubjson::ubjson_type::type_marker), std::back_inserter(sink_)); - binary::native_to_big(static_cast(jsoncons::ubjson::ubjson_type::uint8_type), std::back_inserter(sink_)); + sink_.push_back(static_cast(jsoncons::ubjson::ubjson_type::type_marker)); + sink_.push_back(static_cast(jsoncons::ubjson::ubjson_type::uint8_type)); + sink_.push_back(jsoncons::ubjson::ubjson_type::count_marker); put_length(length); for (auto c : b)