Copy the window contents into the buffer.
198211
def capture
      Gl.glBindTexture Gl::GL_TEXTURE_2D, id
      Gl.glCopyTexImage2D Gl::GL_TEXTURE_2D, 0, Gl::GL_RGBA8, 0, 0, width, height, 0
      self
    end
1180425
private static void copy(ByteBuffer dst, ByteBuffer src) {
    if (dst.hasRemaining() && src.hasRemaining()) {
      // Avoid an allocation if possible.
      if (dst.remaining() >= src.remaining()) {
        dst.put(src);
      } else {
        int count = Math.min(dst.remaining(), src.remaining());
        ByteBuffer slice = src.slice();
        slice.limit(count);
        dst.put(slice);
        src.position(src.position() + count);
      }
    }
  }
25403
public static void copyStream(InputStream is, OutputStream os, int bufferSize)
            throws IOException {
        if (is == null) {
            throw MESSAGES.nullArgument("input stream");
        }
        if (os == null) {
            throw MESSAGES.nullArgument("output stream");
        }
        byte[] buff = new byte[bufferSize];
        int rc;
        while ((rc = is.read(buff)) != -1) { os.write(buff, 0, rc); }
        os.flush();
    }
627604
def copy(string):
    
    win32clipboard.OpenClipboard()
    win32clipboard.EmptyClipboard()
    win32clipboard.SetClipboardText(string)
    win32clipboard.CloseClipboard()
323174
def store_contents(self):
        

        string_buffer = os.linesep.join(
            map(
                lambda x: ",".join(x),
                map(
                    lambda x: map(
                        str,
                        x.values()
                    ),
                    self.rows
                )
            )
        )

        with open(self.name + ".csv", "w") as f:
            f.write(string_buffer)
596302
function copyBuffer(buf, pos, len) {
  var copy = utils.newBuffer(len);
  buf.copy(copy, 0, pos, pos + len);
  return copy;
}
735724
public static void copyToView(
			MemorySegment[] segments,
			int offset,
			int sizeInBytes,
			DataOutputView target) throws IOException {
		for (MemorySegment sourceSegment : segments) {
			int curSegRemain = sourceSegment.size() - offset;
			if (curSegRemain > 0) {
				int copySize = Math.min(curSegRemain, sizeInBytes);

				byte[] bytes = allocateReuseBytes(copySize);
				sourceSegment.get(offset, bytes, 0, copySize);
				target.write(bytes, 0, copySize);

				sizeInBytes -= copySize;
				offset = 0;
			} else {
				offset -= sourceSegment.size();
			}

			if (sizeInBytes == 0) {
				return;
			}
		}

		if (sizeInBytes != 0) {
			throw new RuntimeException("No copy finished, this should be a bug, " +
					"The remaining length is: " + sizeInBytes);
		}
	}
1016776
public void setData(IoBuffer buffer) {
        if (noCopy) {
            log.trace("Using buffer reference");
            this.data = buffer;
        } else {
            // try the backing array first if it exists
            if (buffer.hasArray()) {
                log.trace("Buffer has backing array, making a copy");
                byte[] copy = new byte[buffer.limit()];
                buffer.mark();
                buffer.get(copy);
                buffer.reset();
                data = IoBuffer.wrap(copy);
            } else {
                log.trace("Buffer has no backing array, using ByteBuffer");
                // fallback to ByteBuffer
                data.put(buffer.buf()).flip();
            }
        }
    }
1029916
function(target, targetOffset, offset, length) {
    return this.toBuffer().copy(target, targetOffset, offset, length);
  }
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;
    }
997125
def buffer(self, frame):
        """"""
        frame.buffer = self.temporary_identifier()
        self.writeline('%s = []' % frame.buffer)
686573
SnapshotDescriptor copyTo(Buffer buffer) {
    this.buffer = buffer
        .writeLong(index)
        .writeLong(timestamp)
        .writeInt(version)
        .writeBoolean(locked)
        .skip(BYTES - buffer.position())
        .flush();
    return this;
  }
993207
public void copy() {
		StringBuffer sb = new StringBuffer();

		sb.append("Text 1 = ");
		if (tf1.getText() != null) {
			sb.append(tf1.getText());
		}
		sb.append("\nText 2 = ");
		if (tf2.getText() != null) {
			sb.append(tf2.getText());
		}
		sb.append("\nText 3 = ");
		if (tf3.getText() != null) {
			sb.append(tf3.getText());
		}
		sb.append("\nText 4 = ");
		if (tf4.getText() != null) {
			sb.append(tf4.getText());
		}

		sb.append("\nNumeric 1 = ");
		if (nf1.getText() != null) {
			sb.append(nf1.getText());
		}
		sb.append("\nNumeric 2 = ");
		if (nf2.getText() != null) {
			sb.append(nf2.getText());
		}
		sb.append("\nNumeric 3 = ");
		if (nf3.getText() != null) {
			sb.append(nf3.getText());
		}

		sb.append("\nEmail = ");
		if (ef1.getText() != null) {
			sb.append(ef1.getText());
		}

		if (drop1.getSelected() != null) {
			sb.append("\nDrop 1 = ").append(drop1.getSelected());
		}

		if (drop2.getSelected() != null) {
			sb.append("\nDrop 2 = ").append(drop2.getSelected());
		}

		sb.append("\nMulti1 = ");
		List selected = multi1.getSelected();

		if (selected != null) {
			for (int i = 0; i < selected.size(); i++) {
				if (i > 0) {
					sb.append(", ");
				}

				sb.append(selected.get(i).toString());
			}
		}

		sb.append("\nMulti2 = ");
		selected = multi2.getSelected();

		if (selected != null) {
			for (int i = 0; i < selected.size(); i++) {
				if (i > 0) {
					sb.append(", ");
				}

				TableEntry entry = (TableEntry) selected.get(i);
				sb.append(entry.getCode());
			}
		}

		sb.append("\nMultiCb = ");
		List selectedOptions = multiCb.getSelected();

		for (int i = 0; i < selectedOptions.size(); i++) {
			if (i > 0) {
				sb.append(", ");
			}

			TableEntry entry = (TableEntry) selectedOptions.get(i);
			sb.append(entry.getCode());
		}

		if (rbSelect.getSelected() != null) {
			String radioValue = rbSelect.getSelected().toString();
			sb.append("\nWRadioButtonSelect = ").append(radioValue);
		}

		if (radioButtonGroup.getSelectedValue() != null) {
			String radioValue = radioButtonGroup.getSelectedValue();
			sb.append("\nRadioButtonGroup = ").append(radioValue);
		}

		sb.append("\nCheckboxes =");

		if (cb1.isSelected()) {
			sb.append(' ').append(cb1.getLabel().getText());
		}

		if (cb2.isSelected()) {
			sb.append(' ').append(cb2.getLabel().getText());
		}

		if (cb3.isSelected()) {
			sb.append(' ').append(cb3.getLabel().getText());
		}

		sb.append('\n');

		ta.setText(sb.toString());
	}
445244
public void copyToDirectBuffer() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "copyToDirectBuffer");
        }

        if (oByteBuffer.isDirect()) {
            this.oWsBBDirect = this.oByteBuffer;
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
                Tr.exit(tc, "copyToDirectBuffer, exit point 1");
            }
            return;
        }

        if (this.quickBufferAction == ACTIVATED) {

            synchronized (wsBBRoot.actionAccess) {
                if (wsBBRoot.actionState == PooledWsByteBufferImpl.COPY_WHEN_NEEDED_STATE1) {

                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "bufferAction in STATE1, do not copy");
                    }

                    // no put activity has been done on the NonDirect Buffer, so
                    // the data in the Direct buffer can be written as is
                    this.oWsBBDirect.limit(oByteBuffer.limit());
                    this.oWsBBDirect.position(oByteBuffer.position());

                    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
                        Tr.exit(tc, "copyToDirectBuffer, exit point 2");
                    }
                    return;
                }

                if (wsBBRoot.actionState == PooledWsByteBufferImpl.COPY_WHEN_NEEDED_STATE2) {

                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "bufferAction in STATE2, copy only changed data");
                    }

                    // put activity has been done on the NonDirect Buffer, so
                    // the new data in the nonDirect buffer needs to be copied
                    // down to the Direct Buffer
                    if ((wsBBRoot.putMin != -1) && (wsBBRoot.putMax != -1)) {

                        copyRangeToDirectBuffer(wsBBRoot.putMin, wsBBRoot.putMax);
                        wsBBRoot.putMin = -1;
                        wsBBRoot.putMax = -1;
                    }

                    this.oWsBBDirect.limit(oByteBuffer.limit());
                    this.oWsBBDirect.position(oByteBuffer.position());

                    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
                        Tr.exit(tc, "copyToDirectBuffer, exit point 3");
                    }
                    return;
                }
            } // end-sync
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "buffer optimization is off, copy all data");
        }

        // we are here because either Optimization was never on, or it just switched off.
        if (oWsBBDirect == null) {
            this.oWsBBDirect = ByteBuffer.allocateDirect(oByteBuffer.capacity());
        }

        int cachePosition = this.oByteBuffer.position();
        int cacheLimit = this.oByteBuffer.limit();
        int offset = this.oByteBuffer.arrayOffset();

        // set the position and limit for copying
        this.oWsBBDirect.limit(cacheLimit);
        this.oWsBBDirect.position(cachePosition);

        // copy the bytes from position to limit
        this.oWsBBDirect.put(oByteBuffer.array(), cachePosition + offset, cacheLimit - cachePosition);

        // reset the position
        this.oWsBBDirect.position(cachePosition);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "copyToDirectBuffer, exit point 4");
        }
    }
339915
public static ByteBuf copiedBuffer(ByteBuf buffer) {
        int readable = buffer.readableBytes();
        if (readable > 0) {
            ByteBuf copy = buffer(readable);
            copy.writeBytes(buffer, buffer.readerIndex(), readable);
            return copy;
        } else {
            return EMPTY_BUFFER;
        }
    }
1161742
SegmentDescriptor copyTo(Buffer buffer) {
    this.buffer = buffer
      .writeLong(id)
      .writeLong(version)
      .writeLong(index)
      .writeUnsignedInt(maxSegmentSize)
      .writeInt(maxEntries)
      .writeLong(updated)
      .writeBoolean(locked)
      .skip(BYTES - buffer.position())
      .flush();
    return this;
  }
679781
public void copyEntryContents(OutputStream out) throws IOException {
        byte[] buf = new byte[32 * 1024];

        while (true) {
            int numRead = this.read(buf, 0, buf.length);

            if (numRead == -1) {
                break;
            }

            out.write(buf, 0, numRead);
        }
    }