#include <stingraykit/io/ByteDataConsumer.h>

namespace stingray
{


	ByteDataConsumer::ByteDataConsumer(ByteData consumer)
		:	_consumer(consumer)
	{ }


	size_t ByteDataConsumer::Process(ConstByteData data, const ICancellationToken&)
	{
		const size_t size = data.size();

		STINGRAYKIT_CHECK(size <= _consumer.size(), IndexOutOfRangeException(size, _consumer.size()));

		std::copy(data.data(), data.data() + size, _consumer.data());
		_consumer = ByteData(_consumer, size);

		return size;
	}


}

#include <stingraykit/io/ByteDataConsumer.h>

#include <string.h>


namespace stingray
{


	ByteDataConsumer::ByteDataConsumer(ByteData consumer)
		:	_consumer(consumer)
	{ }


	size_t ByteDataConsumer::Process(ConstByteData data, const ICancellationToken&)
	{
		const size_t size = data.size();

		STINGRAYKIT_CHECK(size <= _consumer.size(), IndexOutOfRangeException(size, _consumer.size()));

		memcpy(_consumer.data(), data.data(), size);
		_consumer = ByteData(_consumer, size);

		return size;
	}


}

Change std::copy to memcpy in critical places.
Change std::copy to memcpy in critical places.

Sadly, std::copy(...) on gcc4.6; mstar k5cn is 1.5-2 times slower than memcpy(...).
Probably the answer is in difference between __builtin_memmove(...) and __builtin_memcpy(...)
on a certain MIPS machine, because libstdc++ uses __builtin_memmove(...) for std::copy(...) on
TriviallyCopyable types.
