Exemplo n.º 1
0
bool MemoryBuffer::copyFrom( const MemoryBuffer& other )
{
	if ( other.getSizeInBytes()!=getSizeInBytes() )
		return false;
	memcpy( mBytes, other.getBytes(), getSizeInBytes() );
	return true;
}
Exemplo n.º 2
0
MemoryBuffer::MemoryBuffer( const MemoryBuffer& other )
	: mBytes(NULL),
	  mSizeInBytes( other.getSizeInBytes() ),
	  mOwnsBytes(true)
{
	mBytes = new unsigned char[mSizeInBytes];
	memcpy( mBytes, other.getBytes(), other.getSizeInBytes() );
}