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