Ejemplo n.º 1
0
int IOBuffer::storeBuffer(IOBuffer& other, rx_uint32 numBytes) {
	// check if we can read this many bytes from other buffer.
	numBytes = other.getMostNumberOfBytesWeCanConsume(numBytes);
	if(numBytes == 0) {
		return 0;
	}
	ensureSize(numBytes);
	memcpy(buffer+published, other.buffer+other.consumed, numBytes);
	published += numBytes;
	other.published += numBytes;
	return numBytes;
}