class ConcatClosingInputStream extends InputStream {

    @Override
    public void close() throws IOException {
        if (closed)
            return;

        IOException ioException = tryClose(current);
        while (streams.hasNext()) {
            IOException exception = tryClose(streams.next());
            ioException = asSuppressedOf(ioException, exception);
        }
        closed = true;

        if (ioException != null)
            throw ioException;
    }

    public  ConcatClosingInputStream(Iterator<InputStream> streams);

}