Add ToSpan for MemoryWriteStream and simplify code with it
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
|
||||
|
||||
#include "MemoryReadStream.h"
|
||||
#include "Engine/Platform/Platform.h"
|
||||
|
||||
MemoryReadStream::MemoryReadStream()
|
||||
: _buffer(nullptr)
|
||||
@@ -22,6 +23,14 @@ void MemoryReadStream::Init(const byte* bytes, uint32 length)
|
||||
_length = length;
|
||||
}
|
||||
|
||||
void* MemoryReadStream::Move(uint32 bytes)
|
||||
{
|
||||
ASSERT(GetLength() - GetPosition() >= bytes);
|
||||
const auto result = (void*)_position;
|
||||
_position += bytes;
|
||||
return result;
|
||||
}
|
||||
|
||||
void MemoryReadStream::Flush()
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user