• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

zipping or not

 
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello all,
in my program I want to parse several flatfiles. Depending on the source (where these files come from originally) a parsing procedure can involve only a single file, or several files (different or same format), or a zipfile with several files (different or same format).
My problem is that I don't want to bother the parser with the I/O stuff - check for the existence of the files, open the streams. In some cases one InputStream would be sufficient, in other cases I seem to need several, and in case of a zipfile I would need a ZipInputStream, or I would need to uncompress the file first.
Now, I had a new idea: what if the program zips all the sourcefiles to appropriate bundles - depending on the source target. Thus, the different parsers would all get just a ZipInputStream. Sure, then they will have to bother with uncompressing, but at least the existence of the files would have been checked before.
Am I totally misguided by this idea? Does the extra compressing mean a big overhead in performance, or would it even gain some time? (At the moment the files are located inside the unix file system or at least in a mounted fs tree where the program will run.)
Any comments on the idea or new suggestions would be very welcome!
Thank you
Chantal
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your idea is logical and clear, but for perfomance issues... i don't know.
Napa
 
Don't play dumb with me! But you can try this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic