OutputStream out = new OutputStreamWrapper();
ArrayList<CountingOutputStream> moreStreams = new ArrayList<CountingOutputStream>();
boolean first = true;
for (SevenZMethodConfiguration m : getContentMethods(files.get(files.size() - 1))) {
if (!first) {
CountingOutputStream cos = new CountingOutputStream(out);
moreStreams.add(cos);
out = cos;
}
out = Coders.addEncoder(out, m.getMethod(), m.getOptions());
first = false;
}
if (!moreStreams.isEmpty()) {
additionalCountingStreams = moreStreams.toArray(new CountingOutputStream[moreStreams.size()]);
}
return new CountingOutputStream(out) {
@Override
public void write(final int b) throws IOException {
super.write(b);
crc32.update(b);
}