public function copy(BitArray $bits, $index = 0, $offset = 0, $size = null)
	{
		$index = $this->getRealOffset($index);
		$offset = $bits->getRealOffset($offset);
		$size = $bits->getRealSize($offset, $size);

		if ($size > $this->size - $index)
		{
			$size = $this->size - $index;
		}

		return $this->directCopy($bits, $index, $offset, $size);
	}
public function copy(BitArray $bits, $index = 0, $offset = 0, $size = null)
	{
		$index = $this->getRealOffset($index);
		$offset = $bits->getRealOffset($offset);
		$size = $bits->getRealSize($offset, $size);

		if ($size > $this->size - $index)
		{
			$size = $this->size - $index;
		}

		return $this->directCopy($bits, $index, $offset, $size);
	}
public function copy ( BitArray $ bits , $ index = 0 , $ offset = 0 , $ size = null ) { $ index = $ this -> getRealOffset ( $ index ) ; $ offset = $ bits -> getRealOffset ( $ offset ) ; $ size = $ bits -> getRealSize ( $ offset , $ size ) ; if ( $ size > $ this -> size - $ index ) { $ size = $ this -> size - $ index ; } return $ this -> directCopy ( $ bits , $ index , $ offset , $ size ) ; }
Copy bits from a BitArray

@param   BitArray  $bits    A BitArray to copy
@param   int       $index   Starting index for destination.
If index is non-negative, the index parameter is used as it is, keeping its real value between 0 and size-1.
If index is negative, the index parameter starts from the end, keeping its real value between 0 and size-1.
@param   int       $offset  Starting index for copying.
If offset is non-negative, the offset parameter is used as it is, keeping its positive value between 0 and size-1.
If offset is negative, the offset parameter starts from the end, keeping its real value between 0 and size-1.
@param   mixed     $size    Copy size.
If size is given and is positive, then the copy will copy size elements.
If the bits argument is shorter than the size, then only the available elements will be copied.
If size is given and is negative then the copy starts from the end.
If it is omitted, then the copy will have everything from offset up until the end of the bits argument.

@return  BitArray  This object for chaining

@since   1.1.0
Copy bits from a BitArray