@Override
    public InputStream asStream() {
        return new SequenceInputStream(new Enumeration<InputStream>() {

            /**
             * Iterator over all resources associated with this
             * SequenceResource.
             */
            private final Iterator<Resource> resourceIterator = resources.iterator();

            @Override
            public boolean hasMoreElements() {
                return resourceIterator.hasNext();
            }

            @Override
            public InputStream nextElement() {
                return resourceIterator.next().asStream();
            }

        });
    }
Creates a new SequenceResource as the logical concatenation of the
given resources. Each resource is concatenated in iteration order as
needed when reading from the input stream of the SequenceResource. The
mimetype of the resulting concatenation is derived from the first
resource.

@param resources
    The resources to concatenate within the InputStream of this
    SequenceResource.
guacamole/src/main/java/org/apache/guacamole/resource/SequenceResource.java