• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Huge file splitting?

 
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have a very big (12MB) zip file.

My question is
1. I want to split(not extracting) this file into 6 file. Is it possible. if yes, how?
2. After splitting(not extracting), Again I want to join all the files into single file.

Please let me know

Thanking You
Regards,
Edward
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have never done this before , but I think it can be done in the following way.There might be some program complexities involved.

As its a zip file(binary) , considering it to be stream of bytes.You can read 2 MB of bytes (ready bytes to a byte array of fixed length , recursively ) and write it to a FileOutputStream for creating the first split file.

Repeat it until you are done with all the available bytes of the main file.

For making a file out of the chunks.You create a FileOutputStream and append all the bytes from it to the stream in order.
 
Of course, I found a very beautiful couch. Definitely. And this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic