diff options
| author | Per Larsson <[email protected]> | 2022-02-21 15:14:11 +0100 |
|---|---|---|
| committer | Per Larsson <[email protected]> | 2022-02-21 15:14:11 +0100 |
| commit | db1c9605e3afbaf86f4231ba4eb7976d896f286b (patch) | |
| tree | 54b451da4247c69575ff1a05ed006ecef3905c85 /zencore/stream.cpp | |
| parent | If open(O_CREAT) is used then a file mode must be given (diff) | |
| parent | Removed optional offset for GetView. (diff) | |
| download | zen-db1c9605e3afbaf86f4231ba4eb7976d896f286b.tar.xz zen-db1c9605e3afbaf86f4231ba4eb7976d896f286b.zip | |
Initial support for websockets.
Diffstat (limited to 'zencore/stream.cpp')
| -rw-r--r-- | zencore/stream.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/zencore/stream.cpp b/zencore/stream.cpp index aa9705764..8faf90af2 100644 --- a/zencore/stream.cpp +++ b/zencore/stream.cpp @@ -25,6 +25,15 @@ BinaryWriter::Write(const void* data, size_t ByteCount, uint64_t Offset) memcpy(m_Buffer.data() + Offset, data, ByteCount); } +void +BinaryWriter::Reset() +{ + RwLock::ExclusiveLockScope _(m_Lock); + + m_Buffer.clear(); + m_Offset = 0; +} + ////////////////////////////////////////////////////////////////////////// // // Testing related code follows... |