@Override public ImmutableList<String> readLines() { return ImmutableList.copyOf(linesIterator()); }
@Override public Stream<String> lines() { return Streams.stream(linesIterator()); }
@Override public ImmutableList<String> readLines() { return ImmutableList.copyOf(lines()); }
@Override public ImmutableList<String> readLines() { return ImmutableList.copyOf(lines()); }
@Override public ImmutableList<String> readLines() { return ImmutableList.copyOf(lines()); }
@Override public ImmutableList<String> readLines() { return ImmutableList.copyOf(linesIterator()); }
@Override public Stream<String> lines() { return Streams.stream(linesIterator()); }
@Override public ImmutableList<String> readLines() { return ImmutableList.copyOf(lines()); }
@Override public ImmutableList<String> readLines() { return ImmutableList.copyOf(lines()); }
@Override public ImmutableList<String> readLines() { return ImmutableList.copyOf(lines()); }
@Override public <T> T readLines(LineProcessor<T> processor) throws IOException { for (String line : lines()) { if (!processor.processLine(line)) { break; } } return processor.getResult(); }
@Override public String readFirstLine() { Iterator<String> lines = lines().iterator(); return lines.hasNext() ? lines.next() : null; }
/** * Returns a view of the given character sequence as a {@link CharSource}. The behavior of the * returned {@code CharSource} and any {@code Reader} instances created by it is unspecified if * the {@code charSequence} is mutated while it is being read, so don't do that. * * @since 15.0 (since 14.0 as {@code CharStreams.asCharSource(String)}) */ public static CharSource wrap(CharSequence charSequence) { return new CharSequenceCharSource(charSequence); }
@Override public String readFirstLine() { Iterator<String> lines = lines().iterator(); return lines.hasNext() ? lines.next() : null; }
@Override public String readFirstLine() { Iterator<String> lines = lines().iterator(); return lines.hasNext() ? lines.next() : null; }
/** * Returns a view of the given character sequence as a {@link CharSource}. The behavior of the * returned {@code CharSource} and any {@code Reader} instances created by it is unspecified if * the {@code charSequence} is mutated while it is being read, so don't do that. * * @since 15.0 (since 14.0 as {@code CharStreams.asCharSource(String)}) */ public static CharSource wrap(CharSequence charSequence) { return new CharSequenceCharSource(charSequence); }
/** * Returns a view of the given character sequence as a {@link CharSource}. The behavior of the * returned {@code CharSource} and any {@code Reader} instances created by it is unspecified if * the {@code charSequence} is mutated while it is being read, so don't do that. * * @since 15.0 (since 14.0 as {@code CharStreams.asCharSource(String)}) */ public static CharSource wrap(CharSequence charSequence) { return charSequence instanceof String ? new StringCharSource((String) charSequence) : new CharSequenceCharSource(charSequence); }
/** * Returns a view of the given character sequence as a {@link CharSource}. The behavior of the * returned {@code CharSource} and any {@code Reader} instances created by it is unspecified if * the {@code charSequence} is mutated while it is being read, so don't do that. * * @since 15.0 (since 14.0 as {@code CharStreams.asCharSource(String)}) */ public static CharSource wrap(CharSequence charSequence) { return new CharSequenceCharSource(charSequence); }
@Override public String readFirstLine() { Iterator<String> lines = lines().iterator(); return lines.hasNext() ? lines.next() : null; }
@Override public String readFirstLine() { Iterator<String> lines = linesIterator(); return lines.hasNext() ? lines.next() : null; }