- final String text = CharStreams.toString(
- CharStreams.newReaderSupplier(new InputSupplier<InputStream>() {
- @Override
- public InputStream getInput() throws IOException {
- return input.openStream();
- }
- }, Charsets.UTF_8));
+ final String text = new ByteSource() {
+ @Override
+ public InputStream openStream() throws IOException {
+ return input.openStream();
+ }
+ }.asCharSource(Charsets.UTF_8).read();