union
{
byte bytes[4];
uint32_t count;
} toWrite;
// strictly speaking this is UB, but it'll do for now
// whilst most use unions to reinterpret bytes, it's UB!
// with that said, most implementations do what's expected
// TODO - correct this
toWrite.count = static_cast<uint32_t>(lookup.size());
target.write(toWrite.bytes, 4);