|
From: Jim M. <jim...@gm...> - 2006-03-01 23:10:38
|
On March 1, 2006, Jim McMaster <> wrote:
> I am trying to create a new zip file containing selected entries from
> another zip file. I am using jazzlib-0.07 with Sun's JDK
> 1.5.0_04 on Redhat
> Fedora Core 4 Linux.
>
> I create an entry in the new file with the same name as the
> one in the old
> file, then call the following method.
>
> ----------------------------
> private void copyEntryData(ZipFile inputZipFile,
> ZipOutputStream zipOutputStream, ZipEntry entry) {
> try { int data = 0;
> InputStream inputStream =
> inputZipFile.getInputStream(entry);
> while ((data = inputStream.read()) >= 0) {
> zipOutputStream.write(data);
> }
> zipOutputStream.flush();
> zipOutputStream.closeEntry();
> inputStream.close();
> } catch (IOException e) {
> final String message = "Unable to read or write file";
> recordException(message, e);
> }
> }
> ----------------------------
>
More information. I definitely am getting all the data from the
inputStream. The problem is in the zipOutputStream.write().
--
Jim McMaster
mailto:jim...@gm...
|