Compresses <code>src</code> into <code>dest</code>. Calling this method
will update the positions of both {@link ByteBuffer}s.

@param src the source data
@param dest the destination buffer
@throws LZ4Exception if dest is too small
334664
public final void compress(ByteBuffer src, ByteBuffer dest) {
    final int cpLen = compress(src, src.position(), src.remaining(), dest, dest.position(), dest.remaining());
    src.position(src.limit());
    dest.position(dest.position() + cpLen);
  }
1277775
public static Object copy(Object src, Object dest, int length) {
		System.arraycopy(src, 0, dest, 0, length);
		return dest;
	}
1178250
public static void matrixCopy(Object[][] src, Object[][] dest) {
        if (src != null && dest != null) {
            for (int i = 0; i < src.length; i++) {
                System.arraycopy(src[i], 0, dest[i], 0, src[i].length);
            }
        }
    }
962876
def xz_compress_stream(src):
    
    compressor = lzma.LZMACompressor(
        check=lzma.CHECK_CRC64,
        filters=[
            {"id": lzma.FILTER_X86},
            {"id": lzma.FILTER_LZMA2,
             "preset": lzma.PRESET_DEFAULT},
        ])
    for block in src:
        encoded = compressor.compress(block)
        if encoded:
            yield encoded
    yield compressor.flush()
1320040
public static int getDecompressedLength(byte[] src, int srcOff) {
    return (src[srcOff] & 0xFF) | (src[srcOff + 1] & 0xFF) << 8 | (src[srcOff + 2] & 0xFF) << 16 | src[srcOff + 3] << 24;
  }
374428
public static void compress(String srcFilePath, String destFilePath) throws Exception {
		File src = new File(srcFilePath);
		if (!src.exists()) {
			throw new RuntimeException(srcFilePath + "不存在");
		}
		File zipFile = new File(destFilePath);
		ZipOutputStream zos=null;
		try {
			FileOutputStream fos = new FileOutputStream(zipFile);
			CheckedOutputStream cos = new CheckedOutputStream(fos, new CRC32());
			zos = new ZipOutputStream(cos);
			String baseDir = "";
			compressbyType(src, zos, baseDir);
		}finally {
			if(zos!=null)
			{
				zos.close();
			}
		}
	}
1064940
private int writePlaintextData(final ByteBuffer src, int len) {
        final int pos = src.position();
        final int limit = src.limit();
        final int sslWrote;

        if (src.isDirect()) {
            sslWrote = SSL.writeToSSL(ssl, bufferAddress(src) + pos, len);
            if (sslWrote > 0) {
                src.position(pos + sslWrote);
            }
        } else {
            ByteBuf buf = alloc.directBuffer(len);
            try {
                src.limit(pos + len);

                buf.setBytes(0, src);
                src.limit(limit);

                sslWrote = SSL.writeToSSL(ssl, memoryAddress(buf), len);
                if (sslWrote > 0) {
                    src.position(pos + sslWrote);
                } else {
                    src.position(pos);
                }
            } finally {
                buf.release();
            }
        }
        return sslWrote;
    }
1367385
public static BufferedImage copy(BufferedImage src, BufferedImage dest) {
        dest.getGraphics().drawImage(src, 0, 0, null);
        return dest;
    }
737104
public static <S, D extends S> void copyFields(final S src, D dest) throws IllegalArgumentException {
		Class<?> targetClass = src.getClass();

		do {
			Field[] fields = targetClass.getDeclaredFields();
			for (Field field : fields) {
				// Skip static fields:
				if (Modifier.isStatic(field.getModifiers())) {
					continue;
				}
				try {
					if ((!Modifier.isPublic(field.getModifiers())
					            || !Modifier.isPublic(field.getDeclaringClass().getModifiers())
					            || Modifier.isFinal(field.getModifiers())) && !field.isAccessible()) {
						field.setAccessible(true);
					}
					Object srcValue = field.get(src);
					field.set(dest, srcValue);
				}
				catch (IllegalAccessException ex) {
					throw new IllegalStateException(
					            "Shouldn't be illegal to access field '" + field.getName() + "': " + ex);
				}
			}
			targetClass = targetClass.getSuperclass();
		}
		while (targetClass != null && targetClass != Object.class);
	}
580321
public void copyTo(long srcOffset, LBufferAPI dest, long destOffset, long size) {
        unsafe.copyMemory(address() + srcOffset, dest.address() + destOffset, size);
    }
604576
public void writeTo(byte[] dest)
    {
        if (dest.length < size)
        {
            throw new IllegalArgumentException("Passed in byte[] is not large enough");
        }

        System.arraycopy(buffer, 0, dest, 0, size);
    }
674285
function LZ4_compress (input, options) {
	var output = []
	var encoder = new Encoder(options)

	encoder.on('data', function (chunk) {
		output.push(chunk)
	})

	encoder.end(input)

	return Buffer.concat(output)
}
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);
	}
1115349
public static ByteBuffer copy(ByteBuffer src, ByteBuffer dest, int length) {
		return copy(src, src.position(), dest, dest.position(), length);
	}
263618
public static void memcopy(byte[] dest, byte[] src, int copyToIndex) {
		System.arraycopy(src, 0, dest, copyToIndex, src.length);
	}
1164025
public static function copy(StreamInterface $src, StreamInterface $dest)
    {
        if ($src->isSeekable()) {
            $src->rewind();
        }

        while (!$src->eof()) {
            $dest->write($src->read(4096));
        }
    }
1244186
public static ByteBuffer copy(ByteBuffer src, int srcStart, ByteBuffer dest, int destStart, int length) {
		System.arraycopy(src.array(), srcStart, dest.array(), destStart, length);
		return dest;
	}