JCLOUDS-622: add Strings2.toString(InputSupplier)

We did not deprecate this in 1.7.x as previously thought.
This commit is contained in:
Andrew Gaul 2014-07-18 21:48:08 -07:00
parent 1fb286809e
commit 0df905a870
1 changed files with 8 additions and 0 deletions

View File

@ -41,6 +41,7 @@ import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.Multimap;
import com.google.common.io.CharStreams;
import com.google.common.io.InputSupplier;
import com.google.common.primitives.Chars;
public class Strings2 {
@ -121,6 +122,13 @@ public class Strings2 {
}
}
/** @deprecated use CharSource.read() instead */
@Deprecated
public static String toString(InputSupplier<? extends InputStream> supplier)
throws IOException {
return toStringAndClose(supplier.getInput());
}
public static String toStringAndClose(InputStream input) throws IOException {
checkNotNull(input, "input");
try {