I am creating a tar.Gzip
file using GZIPOutputStream
and I have added an another logic in that if any Exception caught while compressing file then, my
Case solved. This Exception java.io.IOException: request to write '4096' bytes exceeds size in header of '2644' bytes for entry 'Alldbtypes'
thrown when the size of the file that going to be zipped is incorrect.
TarArchiveEntry entry = new TarArchiveEntry("Alldbtypes");
entry.setSize(getOriginalSize());
In my code getOriginalSize()
is getting updated again at the end so in retry the original size became change and original size is now zipped file size so it was throwing this Exception.