[*] ByteBuffer::WriteFromEx flagExpandable awareness
[*] ByteBuffer::WriteFrom updates flagWriteError on failure
This commit is contained in:
parent
fbca5f22c5
commit
3d763e58b4
@ -18,6 +18,12 @@ namespace Aurora::Memory
|
||||
do
|
||||
{
|
||||
auto readView = buffer.GetNextLinearRead();
|
||||
|
||||
if (this->flagExpandable && !this->CanWrite(readView.length))
|
||||
{
|
||||
this->Resize((this->writePtr - this->base) + readView.length);
|
||||
}
|
||||
|
||||
auto writeView = this->GetNextLinearWrite();
|
||||
|
||||
auto uReadNext = AuMin(readView.length, writeView.length);
|
||||
@ -46,6 +52,8 @@ namespace Aurora::Memory
|
||||
bool ByteBuffer::WriteFrom(ByteBuffer &buffer)
|
||||
{
|
||||
auto readable = buffer.RemainingBytes();
|
||||
return this->WriteFromEx(buffer, readable) == readable;
|
||||
bool bStatus = this->WriteFromEx(buffer, readable) == readable;
|
||||
this->flagWriteError |= !bStatus;
|
||||
return bStatus;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user