Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IZPACK-1497: Serialize actual size of packed file data instead of the size of the original file to enable compression #592

Merged
merged 1 commit into from Mar 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -242,7 +242,14 @@ protected void writePacks() throws IOException
}

long bytesWritten = FileUtils.copyFile(file, finalStream);
finalStream.flush();
try
{
finalStream.flush();
}
catch (IOException ignored)
{
// some compressor output streams don't explicitly support flushing
}
finalStream.close();
if (bytesWritten != packFile.length())
{
Expand Down
Expand Up @@ -125,7 +125,7 @@ protected long copy(PackFile file, InputStream in, File target) throws IOExcepti
OutputStream out = getTarget(file, target);
byte[] buffer = new byte[5120];
long bytesCopied = 0;
long bytesToCopy = (file.isBackReference() ? file.getLinkedPackFile().size() : file.size());
long bytesToCopy = (file.isBackReference() ? file.getLinkedPackFile().length() : file.length());
logger.fine("|- Copying to file system (size: " + bytesToCopy + " bytes)");
try
{
Expand Down