java.io.IOException: request to write '' bytes exceeds size in header of '' bytes for entry ''

后端 未结 1 2124
鱼传尺愫
鱼传尺愫 2021-01-28 00:17

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

相关标签:
1条回答
  • 2021-01-28 00:57

    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.

    0 讨论(0)
提交回复
热议问题