Adding files to zip java using memory while avoiding reserved file name problems -


i want add, remove or modify files in zip using effective way possible.

yes, may should unzip/zip files file system, if there file special name 'aux' or 'con' , doesn't work in windows dos device names, , there might filename encoding issues prevents process working proberly. reason don't unzip file system , re-zip is more slower , takes more disk space using ram.

in image : http://i.stack.imgur.com/ypuyg.png

you use memory bases stream, bytearrayoutputstream read/write contents of file.

the issue amount of available memory, because ram limited, you're going need store output on larger, disk eventually.

in order try , optimism process, set preferred threshold read/write/process operation.

basically run process , calculate how long took, based on preferred threshold, adjust buffer size next loop.

i allow number of loops , average time not trying fine control on buffer might slow down


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -