Extract routing information from source[], it expects that source is properly encoded routing label atleast(5bytes long,
same as dest). It copies data to <b>dest</b> and swamp <i>DPC</i> with <i>OPC</i>.

@param source
@param dest
436901
public static void copyBackRouteHeader(byte[] source, byte[] dest) {
        int thisPointCode = getFromSif_DPC(source, 1);
        int remotePointCode = getFromSif_OPC(source, 1);
        int sls = getFromSif_SLS(source, 1);
        int si = getFromSif_SI(source);
        int ssi = getFromSif_SSI(source);
        writeRoutingLabel(dest, si, ssi, sls, remotePointCode, thisPointCode);
    }
1091186
public void retrieve(DataSource source) {
        try {
            localControlChannel.resetReplyCount();

            if (session.transferMode != GridFTPSession.MODE_EBLOCK) {

                //
                // No EBLOCK
                //

                EBlockParallelTransferContext context =
                    (EBlockParallelTransferContext) createTransferContext();
                context.setEodsTotal(0);

                logger.debug("starting outgoing transfer without mode E");
                if (session.serverMode == Session.SERVER_PASSIVE) {

                    transferThreadManager.passiveConnect(source, context, serverSocket);

                } else {

                    transferThreadManager.startTransfer(
                                                        source,
                                                        context,
                                                        1,
                                                        ManagedSocketBox.NON_REUSABLE);
                }

                return;

            } else if (session.serverMode == Session.SERVER_ACTIVE) {

                //
                // EBLOCK, no striping
                //

                // data channels will share this transfer context
                EBlockParallelTransferContext context =
                    (EBlockParallelTransferContext) createTransferContext();

                int total = gSession.parallel;
                //we should send as many EODS as there are parallel streams
                context.setEodsTotal(total);

                int free = socketPool.countFree();
                int willReuseConnections = (total > free) ? free : total;
                int willCloseConnections = (free > total) ? free - total : 0;
                int needNewConnections = (total > free) ? total - free: 0;

                logger.debug("will reuse " + willReuseConnections +
                             " connections, start " + needNewConnections +
                             " new ones, and close " + willCloseConnections);

                if (needNewConnections > 0 ) {
                    transferThreadManager.activeConnect(this.remoteServerAddress,
                                                        needNewConnections);
                }

                if (willCloseConnections > 0) {
                    transferThreadManager.activeClose(context,
                                                      willCloseConnections);
                }

                transferThreadManager.startTransfer(
                                                    source,
                                                    context,
                                                    willReuseConnections + needNewConnections,
                                                    ManagedSocketBox.REUSABLE);

            } else if (session.serverMode == GridFTPSession.SERVER_EACT) {

                //
                // EBLOCK, striping
                //

                if (stripeRetrContextManager == null) {
                    throw new IllegalStateException();
                }

                int stripes = stripeRetrContextManager.getStripes();

                for (int stripe = 0; stripe < stripes; stripe++) {

                    EBlockParallelTransferContext context =
                        stripeRetrContextManager.getStripeContext(stripe);
                    context.setEodsTotal(gSession.parallel);

                    transferThreadManager.startTransfer(
                                                        source,
                                                        context,
                                                        gSession.parallel,
                                                        ManagedSocketBox.REUSABLE);

                }

            } else {

                //
                // EBLOCK and local server not active
                //

                throw new DataChannelException(
                                               DataChannelException.BAD_SERVER_MODE);
            }
        } catch (Exception e) {
            exceptionToControlChannel(e, "ocurred during retrieve()");
        }
    }
1303918
public static Long decodeLongObjDesc(byte[] src, int srcOffset)
        throws CorruptEncodingException
    {
        try {
            int b = src[srcOffset];
            if (b == NULL_BYTE_HIGH || b == NULL_BYTE_LOW) {
                return null;
            }
            return decodeLongDesc(src, srcOffset + 1);
        } catch (IndexOutOfBoundsException e) {
            throw new CorruptEncodingException(null, e);
        }
    }
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);
        }
    }
951494
public static void copyFile(File src, File dest, StreamMonitor monitor) throws IOException, FileNotFoundException {
        FileInputStream fis = null;
        FileOutputStream fos = null;
        int length = (int) src.length();
        try {
            fis = new FileInputStream(src);
            fos = new FileOutputStream(dest);
            StreamUtils.copyStream(monitor, src.toURI().toURL(), length, fis, fos, true);
        } catch (FileNotFoundException e) {
            reportError(monitor, e, src.toURI().toURL());
            throw e;
        } catch (NullArgumentException e) {
            reportError(monitor, e, src.toURI().toURL());
            throw e;
        } catch (MalformedURLException e) {
            reportError(monitor, e, src.toURI().toURL());
            throw e;
        } catch (IOException e) {
            reportError(monitor, e, src.toURI().toURL());
            throw e;
        }
    }
1277775
public static Object copy(Object src, Object dest, int length) {
		System.arraycopy(src, 0, dest, 0, length);
		return dest;
	}
156966
public void addMapping( byte[] src, String dest ) throws IOException
    {
        if( src.length == 1 )
        {
        	singleByteMappings.put( Integer.valueOf( src[0] & 0xff ), dest );
        }
        else if( src.length == 2 )
        {
            int intSrc = src[0]&0xFF;
            intSrc <<= 8;
            intSrc |= (src[1]&0xFF);
            doubleByteMappings.put( Integer.valueOf( intSrc ), dest );
        }
        else
        {
            throw new IOException( "Mapping code should be 1 or two bytes and not " + src.length );
        }
    }
1026599
@Override
    public File getOutputFile(File dest) {
        String file = origin.getPath() + "/" + origin.getName();
        return new File(dest, file);
    }
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);
	}
890666
def map_copy(source: tcod.map.Map, dest: tcod.map.Map) -> None:
    
    if source.width != dest.width or source.height != dest.height:
        dest.__init__(  # type: ignore
            source.width, source.height, source._order
        )
    dest._Map__buffer[:] = source._Map__buffer[:]
1001862
public static void extractZip(final String path, final File dest) throws IOException {
        extractZip(path, dest, null);
    }
431113
public void copyTo(int srcOffset, byte[] destArray, int destOffset, int size) {
        int cursor = destOffset;
        for (ByteBuffer bb : toDirectByteBuffers(srcOffset, size)) {
            int bbSize = bb.remaining();
            if ((cursor + bbSize) > destArray.length)
                throw new ArrayIndexOutOfBoundsException(String.format("cursor + bbSize = %,d", cursor + bbSize));
            bb.get(destArray, cursor, bbSize);
            cursor += bbSize;
        }
    }
580321
public void copyTo(long srcOffset, LBufferAPI dest, long destOffset, long size) {
        unsafe.copyMemory(address() + srcOffset, dest.address() + destOffset, size);
    }
173066
@JsonCreator
    public static Datasource datasource(final String ds) {
        int colonPos = ds.indexOf(":");
        int slashPos = ds.indexOf("/");

        String nodeAndPort = ds;
        String node;
        int port = -1;
        String resource = "";

        if (slashPos != -1) {
            nodeAndPort = ds.substring(0, slashPos);
            resource = ds.substring(slashPos+1);
        }
        if (colonPos != -1) {
            node = nodeAndPort.substring(0, colonPos);
            port = valueOf(nodeAndPort.substring(colonPos+1));
            return datasource(node, port, resource);
        } else {
            return datasource(nodeAndPort, -1, resource);
        }
    }
1322418
private String toSource(Node n, SourceMap sourceMap, boolean firstOutput) {
    CodePrinter.Builder builder = new CodePrinter.Builder(n);
    builder.setTypeRegistry(getTypeRegistry());
    builder.setCompilerOptions(options);
    builder.setSourceMap(sourceMap);
    builder.setTagAsTypeSummary(!n.isFromExterns() && options.shouldGenerateTypedExterns());
    builder.setTagAsStrict(firstOutput && options.shouldEmitUseStrict());
    return builder.build();
  }
204999
private void copyFile(String path, File dest) {
        String resourceName= "native/" + path;
        try
        {
            LOG.debug("Copy from resource <"+resourceName+"> to target <"+dest.getAbsolutePath()+">");
            if (copy(getClass().getResourceAsStream(resourceName), dest.getAbsolutePath()))
            {
                if (dest.exists())
                {
                    LOG.debug("Target <"+dest.getAbsolutePath()+"> exists");
                }
                else
                {
                    LOG.fatal("Target <"+dest.getAbsolutePath()+"> does not exist");
                }
            }
            else
            {
                LOG.fatal("Copy resource to target <"+dest.getAbsolutePath()+"> failed");
            }
        }
        catch (NullPointerException ex)
        {
            LOG.error("Could not find ffmpeg executable for "+resourceName+" is the correct platform jar included?");
            throw ex;
        }
    }
483787
public ServerRedirect addServerMapping(String sourceHost, String destinationHost, String hostHeader) {
        JSONObject response = null;

        ArrayList<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>();
        params.add(new BasicNameValuePair("srcUrl", sourceHost));
        params.add(new BasicNameValuePair("destUrl", destinationHost));
        params.add(new BasicNameValuePair("profileIdentifier", this._profileName));
        if (hostHeader != null) {
            params.add(new BasicNameValuePair("hostHeader", hostHeader));
        }

        try {
            BasicNameValuePair paramArray[] = new BasicNameValuePair[params.size()];
            params.toArray(paramArray);
            response = new JSONObject(doPost(BASE_SERVER, paramArray));
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
        return getServerRedirectFromJSON(response);
    }