diff -r 3874575d924d -r cffa2777d917 sources/network/bytestream.cpp --- a/sources/network/bytestream.cpp Fri Dec 12 00:55:51 2014 +0200 +++ b/sources/network/bytestream.cpp Fri Dec 12 01:37:04 2014 +0200 @@ -47,7 +47,6 @@ Bytestream::Bytestream (const unsigned char* data, unsigned long length) : m_data (nullptr) { - m_data = nullptr; init (data, length); } @@ -61,6 +60,21 @@ // ------------------------------------------------------------------------------------------------- // +Bytestream::Bytestream (const Bytestream& other) : + m_data (nullptr) +{ + init (other.data(), other.written_length()); +} + +// ------------------------------------------------------------------------------------------------- +METHOD Bytestream::operator= (const Bytestream& other) -> Bytestream& +{ + init (other.data(), other.written_length()); + return *this; +} + +// ------------------------------------------------------------------------------------------------- +// Bytestream::~Bytestream() { delete m_data;