Copy all pending entries in this queue into the destination queue.
@param dest to copy pending buffers to.
968980
public final void copyTo(AbstractCoalescingBufferQueue dest) {
        dest.bufAndListenerPairs.addAll(bufAndListenerPairs);
        dest.incrementReadableBytes(readableBytes);
    }
503875
def copy_to(self, dest, buffering: int = -1):
        '''
        
        '''
        if isinstance(dest, str):
            dest_path = dest
        elif isinstance(dest, FileInfo):
            dest_path = dest.path
        elif isinstance(dest, DirectoryInfo):
            dest_path = dest.path / self.path.name
        else:
            raise TypeError('dest is not one of `str`, `FileInfo`, `DirectoryInfo`')

        with open(self._path, 'rb', buffering=buffering) as source:
            # use x mode to ensure dest does not exists.
            with open(dest_path, 'xb') as dest_file:
                for buffer in source:
                    dest_file.write(buffer)
397179
public static void copyBufferedStream(BufferedInputStream sourceStream, BufferedOutputStream destinationStream,
			boolean closeStreams) throws IOException {
		byte[] buffer = new byte[8192];
		int bytesRead = 0;

		try {
			while ((bytesRead = sourceStream.read(buffer)) != -1) {
				destinationStream.write(buffer, 0, bytesRead);
			}
		} finally {
			if (closeStreams) {
				sourceStream.close();
				destinationStream.close();
			}
		}
	}
237174
public static void shallowCopyFieldState(final Object src, final Object dest) {
		if (src == null) {
			throw new IllegalArgumentException("Source for field copy cannot be null");
		}
		if (dest == null) {
			throw new IllegalArgumentException("Destination for field copy cannot be null");
		}
		if (!src.getClass().isAssignableFrom(dest.getClass())) {
			throw new IllegalArgumentException("Destination class [" + dest.getClass().getName() +
					"] must be same or subclass as source class [" + src.getClass().getName() + "]");
		}
		doWithFields(src.getClass(), new FieldCallback() {
			@Override
			public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {
				makeAccessible(field);
				Object srcValue = field.get(src);
				field.set(dest, srcValue);
			}
		}, COPYABLE_FIELDS);
	}
727439
protected function copyFile($source, $dest)
  {
    $dir  = dirname($dest);

    if (!is_dir($dir)) {
      mkdir($dir, 0777, true);
    }

    if (is_uploaded_file($source)) {
      $res = @move_uploaded_file($source, $dest);
    } else {
      $res = @copy($source, $dest);
    }

    if (!$res) {
      $err = error_get_last();

      Exception::ThrowError(Exception::PROCESSING_FILE, $err['message']);
    }
  }
60304
public function copy($src, $dest)
    {
        if (is_dir($src)) {
            $this->ensureDir($dest);
            $files = scandir($src);
            foreach ($files as $file) {
                if ($file !== '.' && $file !== '..') {
                    $this->copy($src . '/' . $file, $dest . '/' . $file);
                }
            }
        } else {
            $this->ensureDir(dirname($dest));

            copy($src, $dest);
        }
    }
640874
@Override
    public void write(File dest) {
        if (origin instanceof FileOrigin) {
            File target = getOutputFile(dest);

            FileOrigin fo = (FileOrigin) origin;
            if (target.exists() && target.length() == fo.getLength()
                    && target.lastModified() >= fo.getLastModified()) {
                //log.debug("Target file is newer than source file, skip copying.");
                return;
            }
            try {
                File parentFile = target.getParentFile();
                if (!parentFile.exists()) {
                    parentFile.mkdirs();
                }

                log.debug("Copying static file to " + target);
                FileUtils.copyFile(fo.getFile(), target);
            } catch (IOException e) {
                log.error("Copying static file error: " + target, e);
                throw new RuntimeException(e);
            }
        } else {
            log.warn("Origin not support yet: " + origin);
        }
    }
950178
public function pipe($dest)
    {
        $source              = $this;
        $this->onMessage     = function ($source, $data) use ($dest) {
            $dest->send($data);
        };
        $this->onClose       = function ($source) use ($dest) {
            $dest->destroy();
        };
        $dest->onBufferFull  = function ($dest) use ($source) {
            $source->pauseRecv();
        };
        $dest->onBufferDrain = function ($dest) use ($source) {
            $source->resumeRecv();
        };
    }
1322476
public void duplicate(Text destination) {
        System.arraycopy(chars, pos, destination.chars, destination.pos, len);
        destination.len = len;
    }
855697
private void transfer(Entry[] src, Entry[] dest)
    {
        for (int j = 0; j < src.length; ++j)
        {
            Entry e = src[j];
            src[j] = null;
            while (e != null)
            {
                Entry next = e.getState().next;
                Object key = e.get();
                if (key == null)
                {
                    e.setNext(null);  // Help GC
                    size--;
                }
                else
                {
                    int i = indexFor(e.getHash(), dest.length);
                    e.setNext(dest[i]);
                    dest[i] = e;
                }
                e = next;
            }
        }
    }
38539
protected static function copyRecursive( $src, $dest )
	{
		self::createDirectory( $dest );

		$iterator = new \RecursiveIteratorIterator(
			new \RecursiveDirectoryIterator( $src, \RecursiveDirectoryIterator::SKIP_DOTS ),
			\RecursiveIteratorIterator::SELF_FIRST
		);

		foreach( $iterator as $item )
		{
			$target = $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName();

			if( $item->isDir() === false )
			{
				if( copy( $item, $target ) === false ) {
					throw new \RuntimeException( sprintf( 'Unable to copy file "%1$s"', $item ) );
				}
			}
			else
			{
				self::createDirectory( $target );
			}
		}
	}
569627
public static void copyAttributes(Element source, Map<String, String> dest) {
        NamedNodeMap attributes = source.getAttributes();

        if (attributes != null) {
            for (int i = 0; i < attributes.getLength(); i++) {
                Node attribute = attributes.item(i);
                dest.put(attribute.getNodeName(), attribute.getNodeValue());
            }
        }
    }
1204992
def _copy_future_state(source, dest):
    
    assert source.done()
    if dest.cancelled():
        return
    assert not dest.done()
    if source.cancelled():
        dest.cancel()
    else:
        exception = source.exception()
        if exception is not None:
            dest.set_exception(exception)
        else:
            result = source.result()
            dest.set_result(result)
217409
public static TextContainer copy(TextContainer src, TextContainer dest) {
        return TextParams.copy(src, dest);
    }
807242
private final void expeditedInsert(T t) {
        expeditedBuffer[expeditedPutIndex] = t;

        if (++expeditedPutIndex >= expeditedBuffer.length) {
            expeditedPutIndex = 0;
        }
    }
632995
protected void queueBuffers (int buffers)
    {
        for (int ii = 0; ii < buffers; ii++) {
            Buffer buffer = _buffers[(_qidx + _qlen) % _buffers.length];
            if (populateBuffer(buffer)) {
                _source.queueBuffers(buffer);
                _qlen++;
            } else {
                break;
            }
        }
    }
1277775
public static Object copy(Object src, Object dest, int length) {
		System.arraycopy(src, 0, dest, 0, length);
		return dest;
	}