Improvements

This commit is contained in:
Wojtek Figat
2022-09-15 13:13:16 +02:00
parent e6996ff22f
commit 75221baa19
5 changed files with 165 additions and 31 deletions

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
#include "NetworkStream.h"
@@ -38,6 +38,15 @@ void NetworkStream::Initialize(uint32 minCapacity)
_position = _buffer;
}
void NetworkStream::Initialize(byte* buffer, uint32 length)
{
if (_allocated)
Allocator::Free(_buffer);
_position = _buffer = buffer;
_length = length;
_allocated = false;
}
void NetworkStream::Flush()
{
// Nothing to do