class IOUtil {

    public static void copy(@NonNull InputStream input, @NonNull OutputStream output) throws IOException {
        final byte[] buffer = new byte[1024];
        int bytesRead;
        while ((bytesRead = input.read(buffer)) != -1) {
            output.write(buffer, 0, bytesRead);
        }
        output.flush();
    }

}