I want to export the file in the package in my Java project. I use I / O for this. I can specify its location in InputStream as src / packagename / filename, it works like this, but it doesn't work when I make jar file.Also, I want to print out how much has been transferred from the code below, finally I want to show it in the progress bar. How can I do?
        inputStream = new FileInputStream(file1);
        outputStream = new FileOutputStream(file2);
        byte[] buffer = new byte[1024 * 4];
        int length;
        while ((length = inputStream.read(buffer)) > 0) {
        outputStream.write(buffer, 0, length);
        }
        
        file1.delete();
 
    