brooklyn.util.stream.InputStreamSupplier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of brooklyn-utils-common Show documentation
Show all versions of brooklyn-utils-common Show documentation
Utility classes and methods developed for Brooklyn but not dependendent on Brooklyn or much else
package brooklyn.util.stream;
import java.io.IOException;
import java.io.InputStream;
import com.google.common.io.InputSupplier;
public class InputStreamSupplier implements InputSupplier {
final InputStream target;
public InputStreamSupplier(InputStream target) {
this.target = target;
}
@Override
public InputStream getInput() throws IOException {
return target;
}
public static InputStreamSupplier fromString(String input) {
return new InputStreamSupplier(Streams.fromString(input));
}
}