Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8483319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:04:08+00:00 2026-06-10T20:04:08+00:00

I have a java application that writes a RandomAccessFile to the file system. It

  • 0

I have a java application that writes a RandomAccessFile to the file system. It has to be a RAF because some things are not known until the end, where I then seek back and write some information at the start of the file.

I would like to somehow put the file into a zip archive. I guess I could just do this at the end, but this would involve copying all the data that has been written so far. Since these files can potentially grow very large, I would prefer a way that somehow did not involve copying the data.

Is there some way to get something like a “ZipRandomAccessFile”, a la the ZipOutputStream which is available in the jdk?

It doesn’t have to be jdk only, I don’t mind taking in third party libraries to get the job done.

Any ideas or suggestions..?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T20:04:10+00:00Added an answer on June 10, 2026 at 8:04 pm

    Maybe you need to change the file format so it can be written sequentially.

    In fact, since it is a Zip and Zip can contain multiple entries, you could write the sequential data to one ZipEntry and the data known ‘only at completion’ to a separate ZipEntry – which gives the best of both worlds.

    It is easy to write, not having to go back to the beginning of the large sequential chunk. It is easy to read – if the consumer needs to know the ‘header’ data before reading the larger resource, they can read the data in that zip entry before proceeding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Java GUI-based application that writes some diagnostic messages to System.out and
I have an applet (java) that writes some files to the client file system.
I have a java application that people can log into (and do various things
I have a Java application that makes heavy use of a large file, to
I have a JSP java application that has a name AAA-master so currently my
Hi I have some code that uses block RandomAccessFile file = new RandomAccessFile(some file,
I have an application that writes information to file. This information is used post-execution
I have written a standalone Java application that I've packaged into a jar file
My Task: I have a Java Application that writes text files. These files should
I have a Java application that run as a background service, i.e. no GUI.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.