// Copyright Epic Games, Inc. All Rights Reserved. #include #include #include #include #include #include namespace zen { void BinaryWriter::Write(const void* data, size_t ByteCount, uint64_t Offset) { RwLock::ExclusiveLockScope _(m_Lock); const size_t NeedEnd = Offset + ByteCount; if (NeedEnd > m_Buffer.size()) { m_Buffer.resize(NeedEnd); } memcpy(m_Buffer.data() + Offset, data, ByteCount); } void BinaryWriter::Reset() { RwLock::ExclusiveLockScope _(m_Lock); m_Buffer.clear(); m_Offset = 0; } ////////////////////////////////////////////////////////////////////////// // // Testing related code follows... // #if ZEN_WITH_TESTS void stream_forcelink() { } #endif } // namespace zen