diff --git a/src/stream.cpp b/src/stream.cpp index d171830..8cac8cb 100644 --- a/src/stream.cpp +++ b/src/stream.cpp @@ -13,11 +13,9 @@ Stream::Stream(std::vector& bytes) : bytes(bytes) {} Stream::~Stream() = default; void Stream::Write(std::string_view string) { + bytes.insert(bytes.end(), string.begin(), string.end()); + const auto size{string.size()}; - const auto data{reinterpret_cast(string.data())}; - for (std::size_t i = 0; i < size; i++) { - Write(data[i]); - } for (std::size_t i = 0; i < 4 - size % 4; i++) { Write(static_cast(0)); }