Copies all content from {@code from} to {@code to}.
502240
@Private
  static StringBuilder read(Readable from) throws IOException {
    StringBuilder builder = new StringBuilder();
    CharBuffer buf = CharBuffer.allocate(2048);
    for (; ; ) {
      int r = from.read(buf);
      if (r == -1) break;
      buf.flip();
      builder.append(buf, 0, r);
    }
    return builder;
  }
306014
function (from, to) {
            return (new java.io.File(from)).renameTo((new java.io.File(to)));
        }
344860
public void copyRenderTo(final Options from, final Options to) {
        if (to.getChartOptions() == null) {
            to.setChartOptions(new ChartOptions());
        }
        to.getChartOptions().setRenderTo(from.getChartOptions().getRenderTo());
    }
1117648
protected function copy($from, $to = null)
    {
        if (is_array($from) && is_null($to)) {
            foreach ($from as $key => $value) {
                $this->copy($key, $value);
            }

            return;
        }

        if (!file_exists($from)) {
            return;
        }

        $to = $this->extensionPath($to);

        $this->filesystem->copy($from, $to);
    }
368558
function merge(from, to) {
    to.name = from.name;

    if (from.selfClosing) {
        to.selfClosing = true;
    }

    if (from.value != null) {
        to.value = from.value;
    }

    if (from.repeat) {
        to.repeat = Object.assign({}, from.repeat);
    }

    return mergeAttributes(from, to);
}
850971
public static byte[] copy(byte[] array, int from, int to) {
        if(to - from < 0) {
            return new byte[0];
        } else {
            byte[] a = new byte[to - from];
            System.arraycopy(array, from, a, 0, to - from);
            return a;
        }
    }
903244
def copy(self):
        """"""
        content = [(k, v) for k, v in self.items()]

        intidx = [(k, v) for k, v in content if isinstance(k, int)]
        args = [v for k, v in sorted(intidx)]

        kwargs = {k: v
                  for k, v in content
                  if not isinstance(k, int) and not self.is_special(k)}
        return self.__class__(*args, **kwargs)
1370884
public static <S, T> Copy<S, T> to(Position.Readable<T> targetPosition, Position.Readable<S> sourcePosition) {
        return new Copy<>(sourcePosition, targetPosition);
    }
88781
public static float[] copyOfRange(final float[] original, final int from, final int to) {
        if (from == 0 && to == original.length) {
            return original.clone();
        }

        final int newLength = to - from;
        final float[] copy = new float[newLength];
        copy(original, from, copy, 0, Math.min(original.length - from, newLength));
        return copy;
    }
1293558
@SneakyThrows(IOException.class)
    private ByteBuffer copyData(List<ReadResultEntryContents> contents) {
        int totalSize = contents.stream().mapToInt(ReadResultEntryContents::getLength).sum();

        ByteBuffer data = ByteBuffer.allocate(totalSize);
        int bytesCopied = 0;
        for (ReadResultEntryContents content : contents) {
            int copied = StreamHelpers.readAll(content.getData(), data.array(), bytesCopied, totalSize - bytesCopied);
            Preconditions.checkState(copied == content.getLength(), "Read fewer bytes than available.");
            bytesCopied += copied;
        }
        return data;
    }
178424
private static byte[] copy(byte[] from) {
    if (from != null) {
      byte[] to = new byte[from.length];
      System.arraycopy(from, 0, to, 0, to.length);
      return to;
    }
    return null;
  }
636508
public Buffer copyTo(OutputStream out, long offset, long byteCount) throws IOException {
    if (out == null) throw new IllegalArgumentException("out == null");
    checkOffsetAndCount(size, offset, byteCount);
    if (byteCount == 0) return this;

    // Skip segments that we aren't copying from.
    Segment s = head;
    for (; offset >= (s.limit - s.pos); s = s.next) {
      offset -= (s.limit - s.pos);
    }

    // Copy from one segment at a time.
    for (; byteCount > 0; s = s.next) {
      int pos = (int) (s.pos + offset);
      int toCopy = (int) Math.min(s.limit - pos, byteCount);
      out.write(s.data, pos, toCopy);
      byteCount -= toCopy;
      offset = 0;
    }

    return this;
  }
1083396
void copyTo(final File destinationFolder) throws IOException {
    for (final File f : this.theFiles) {
      final File destinationFile = new File(destinationFolder, f.getName());
      Files.copy(f.toPath(), destinationFile.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
    }
  }
141490
public static <T> T[] copyOfRange(final T[] original, final int from, final int to, final int step) {
        return copyOfRange(original, from, to, step, (Class<T[]>) original.getClass());
    }
871438
public static InputStream cloneContent(InputStream source, long readbackSize, ByteArrayOutputStream target) throws IOException {
        return cloneContent(source, (int)Math.min((long)Integer.MAX_VALUE, readbackSize), target);
    }
805737
public <Dest> Dest copyTo(Object dest, String... excludes) {
		return from(dest)
				.setExchanges(exchangeProps)
				.setExchangeFuncs(exchangeFuncs)
				.setAutoExchange(autoExchange)
				.setExcludePackagePath(excludePackagePath)
				.setTrace(trace)
				.populate(asMap(), excludes).get();
	}
666317
public static int copyAllBytes(InputStream in, OutputStream out) throws IOException {
        int byteCount = 0;
        byte[] buffer = new byte[BUFFER_SIZE];
        while (true) {
            int read = in.read(buffer);
            if (read == -1) {
                break;
            }
            out.write(buffer, 0, read);
            byteCount += read;
        }
        return byteCount;
    }