public static void streamCopy(InputStream is, OutputStream os) throws IOException {

        byte[] buffer = new byte[1024 * 1024];

        int bytesRead;

        while ((bytesRead = is.read(buffer)) > 0) {
            os.write(buffer, 0, bytesRead);
        }
      
    }