MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ write_blob()

void MayaFlux::Transitive::Protocol::write_blob ( std::vector< uint8_t > &  out,
const std::vector< uint8_t > &  blob 
)
inline

Append a length-prefixed blob padded to 4-byte boundary.

Format: [int32 size (big-endian)][data, zero-padded to 4-byte boundary].

Parameters
outDestination buffer.
blobBytes to write.

Definition at line 173 of file BinaryBuffer.hpp.

175{
176 write_int32(out, static_cast<int32_t>(blob.size()));
177 out.insert(out.end(), blob.begin(), blob.end());
178 size_t padded = padded_size(blob.size());
179 out.resize(out.size() + (padded - blob.size()), 0);
180}
void write_int32(std::vector< uint8_t > &out, int32_t val)
Append a big-endian int32.
constexpr size_t padded_size(size_t len) noexcept
Round len up to the next 4-byte boundary.

References padded_size(), and write_int32().

Referenced by MayaFlux::Core::OscParser::serialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: