title: How to estimate zip file size in java before creating it
body: <p>I am having a requirement wherein i have to create a zip file from a list of available files. The files are of different types like txt,pdf,xml etc.I am using java util classes to do it.</p>
  
  <p>The requirement here is to maintain a maximum file size  of 5 mb. I should select the files from list based on timestamp, add the files to zip until the zip file size reaches 5 mb. I should skip the remaining files.</p>
  
  <p>Please let me know if there is a way in java where in i can estimate the zip file size in advance without creating actual file?</p>
  
  <p>Or is there any other approach to handle this</p>