OS.write(reinterpret_cast<const char *>(&BaseData), InfoSize);
uint32_t ResourceCount = static_cast<uint32_t>(Resources.size());
- if (sys::IsBigEndianHost)
+ if (sys::IsBigEndianHost) {
sys::swapByteOrder(ResourceCount);
- OS.write(reinterpret_cast<const char *>(&ResourceCount), sizeof(uint32_t));
+ sys::swapByteOrder(BindingSize);
+ }
+ OS.write(reinterpret_cast<const char *>(&ResourceCount), sizeof(uint32_t));
OS.write(reinterpret_cast<const char *>(&BindingSize), sizeof(uint32_t));
+
for (const auto &Res : Resources)
OS.write(reinterpret_cast<const char *>(&Res), BindingSize);
}