Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Dec 10, 2022
1 parent fe39a8e commit f4eb199
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.io.OutputStream;

import org.apache.commons.compress.MemoryLimitException;
import org.tukaani.xz.FinishableOutputStream;
import org.tukaani.xz.FinishableWrapperOutputStream;
import org.tukaani.xz.LZMA2InputStream;
import org.tukaani.xz.LZMA2Options;
Expand All @@ -48,11 +47,10 @@ InputStream decode(final String archiveName, final InputStream in, final long un
}
}

@SuppressWarnings("resource") // Caller closes result.
@Override
OutputStream encode(final OutputStream out, final Object opts) throws IOException {
final LZMA2Options options = getOptions(opts);
final FinishableOutputStream wrapped = new FinishableWrapperOutputStream(out);
return options.getOutputStream(wrapped);
return getOptions(opts).getOutputStream(new FinishableWrapperOutputStream(out));
}

@Override
Expand Down

0 comments on commit f4eb199

Please sign in to comment.