@@ -0,0 +1,969 @@
+package at.ac.univie.isc.asio.spring;%0A%0Aimport com.google.common.io.ByteSource;%0Aimport org.springframework.core.io.Resource;%0A%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0A%0Aimport static java.util.Objects.requireNonNull;%0A%0A/**%0A * Adapt a Spring %7B@code Resource%7D to the Guava %7B@code ByteSource%7D contract.%0A */%0Apublic final class SpringByteSource extends ByteSource %7B%0A  /**%0A   * Wrap a spring resource as ByteSource.%0A   * @param delegate spring resource%0A   * @return wrapping ByteSource%0A   */%0A  public static SpringByteSource asByteSource(final Resource delegate) %7B%0A    requireNonNull(delegate);%0A    return new SpringByteSource(delegate);%0A  %7D%0A%0A  private final Resource delegate;%0A%0A  private SpringByteSource(final Resource delegate) %7B%0A    this.delegate = delegate;%0A  %7D%0A%0A  @Override%0A  public InputStream openStream() throws IOException %7B%0A    return delegate.getInputStream();%0A  %7D%0A%0A  @Override%0A  public String toString() %7B%0A    return delegate.getDescription();%0A  %7D%0A%7D%0A

Add ByteSource adapter for Spring resources