in src/main/org/apache/ant/compress/taskdefs/PackBase.java [215:233]
private void pack() {
InputStream in = null;
OutputStream out = null;
try {
in = src.getInputStream();
out = StreamHelper.getOutputStream(factory, dest);
if (out == null) {
out =
factory.getCompressorStream(new BufferedOutputStream(dest.getOutputStream()));
}
IOUtils.copy(in, out, BUFFER_SIZE);
} catch (IOException e) {
throw new BuildException("Error compressing " + src.getName()
+ " to " + dest.getName(), e);
} finally {
FileUtils.close(in);
FileUtils.close(out);
}
}