code/libraries/joomlatools/library/filesystem/stream/abstract.php
public function copy($stream)
    {
        if($this->getResource())
        {
            if (!$stream instanceof KFilesystemStreamInterface && !is_resource($stream) && !get_resource_type($stream) == 'stream')
            {
                throw new InvalidArgumentException(sprintf(
                    'Stream must be on object implementing the FilesystemStreamInterface or a resource of type "stream".'
                ));
            }

            if($stream instanceof KFilesystemStreamInterface) {
                $resource = $stream->getResource();
            } else {
                $resource = $stream;
            }

            return fwrite($resource, $this->read());
        }

        return false;
    }
public function copy($stream)
    {
        if($this->getResource())
        {
            if (!$stream instanceof KFilesystemStreamInterface && !is_resource($stream) && !get_resource_type($stream) == 'stream')
            {
                throw new InvalidArgumentException(sprintf(
                    'Stream must be on object implementing the FilesystemStreamInterface or a resource of type "stream".'
                ));
            }

            if($stream instanceof KFilesystemStreamInterface) {
                $resource = $stream->getResource();
            } else {
                $resource = $stream;
            }

            return fwrite($resource, $this->read());
        }

        return false;
    }
public function copy ( $ stream ) { if ( $ this -> getResource ( ) ) { if ( ! $ stream instanceof KFilesystemStreamInterface && ! is_resource ( $ stream ) && ! get_resource_type ( $ stream ) == 'stream' ) { throw new InvalidArgumentException ( sprintf ( 'Stream must be on object implementing the FilesystemStreamInterface or a resource of type "stream".' ) ) ; } if ( $ stream instanceof KFilesystemStreamInterface ) { $ resource = $ stream -> getResource ( ) ; } else { $ resource = $ stream ; } return fwrite ( $ resource , $ this -> read ( ) ) ; } return false ; }
Copy data from one stream to another stream

@param resource|KFilesystemStreamInterface $stream The stream resource to copy the data too
@return bool Returns TRUE on success, FALSE on failure
Copy data from one stream to another stream