Emulate behavior of ZipOutputStream when disk is full
@@ -1136,7 +1136,6 @@ public class OdfPackage implements Closeable {
rootEntry.setMediaTypeString(mMediaType);
}
ZipArchiveOutputStream zos = new ZipArchiveOutputStream(odfStream);
- try {
// remove mediatype path and use it as first
this.mManifestEntries.remove(OdfFile.MEDIA_TYPE.getPath());
Set<String> keys = mManifestEntries.keySet();
@@ -1167,10 +1166,8 @@ public class OdfPackage implements Closeable {
// added
data = getBytes(OdfFile.MANIFEST.getPath());
createZipEntry(OdfFile.MANIFEST.getPath(), data, zos, modTime, crc);
- } finally {
zos.flush();
zos.close();
- }
odfStream.flush();
}
