@@ -0,0 +1,1656 @@
+/*******************************************************************************%0A * Copyright (c) 2016 IBH SYSTEMS GmbH and others.%0A * All rights reserved. This program and the accompanying materials%0A * are made available under the terms of the Eclipse Public License v1.0%0A * which accompanies this distribution, and is available at%0A * http://www.eclipse.org/legal/epl-v10.html%0A *%0A * Contributors:%0A *     IBH SYSTEMS GmbH - initial API and implementation%0A *******************************************************************************/%0Apackage org.eclipse.packagedrone.utils.io;%0A%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.io.OutputStream;%0Aimport java.util.Objects;%0A%0A/**%0A * Helper class working with %7B@link InputStream%7Ds and %7B@link OutputStream%7Ds%0A */%0Apublic final class Streams%0A%7B%0A    private static final int COPY_BUFFER_SIZE = 8 * 1024;%0A%0A    private Streams ()%0A    %7B%0A    %7D%0A%0A    /**%0A     * Copy the remaining content of one stream to the other%0A     * %0A     * @param in%0A     *            the input stream%0A     * @param out%0A     *            the output stream%0A     * @return the number of bytes copied%0A     * @throws IOException%0A     *             if any I/O error occurs%0A     */%0A    public static long copy ( final InputStream in, final OutputStream out ) throws IOException%0A    %7B%0A        Objects.requireNonNull ( in );%0A        Objects.requireNonNull ( out );%0A%0A        final byte%5B%5D buffer = new byte%5BCOPY_BUFFER_SIZE%5D;%0A        long result = 0;%0A%0A        int rc;%0A        while ( ( rc = in.read ( buffer ) ) %3E= 0 )%0A        %7B%0A            result += rc;%0A            out.write ( buffer, 0, rc );%0A        %7D%0A%0A        return result;%0A    %7D%0A%7D%0A

Add Streams.copy method to not always require guava or commons-io