@Override public Reader openStream() throws IOException { return new MultiReader(sources.iterator()); }
/** Closes the current reader and opens the next one, if any. */ private void advance() throws IOException { close(); if (it.hasNext()) { current = it.next().openStream(); } }
MultiReader(Iterator<? extends CharSource> readers) throws IOException { this.it = readers; advance(); }
MultiReader(Iterator<? extends CharSource> readers) throws IOException { this.it = readers; advance(); }
@Override public long skip(long n) throws IOException { Preconditions.checkArgument(n >= 0, "n is negative"); if (n > 0) { while (current != null) { long result = current.skip(n); if (result > 0) { return result; } advance(); } } return 0; }
/** Closes the current reader and opens the next one, if any. */ private void advance() throws IOException { close(); if (it.hasNext()) { current = it.next().openStream(); } }
@Override public Reader openStream() throws IOException { return new MultiReader(sources.iterator()); }
MultiReader(Iterator<? extends CharSource> readers) throws IOException { this.it = readers; advance(); }
/** Closes the current reader and opens the next one, if any. */ private void advance() throws IOException { close(); if (it.hasNext()) { current = it.next().openStream(); } }
@Override public Reader openStream() throws IOException { return new MultiReader(sources.iterator()); }
@Override public long skip(long n) throws IOException { Preconditions.checkArgument(n >= 0, "n is negative"); if (n > 0) { while (current != null) { long result = current.skip(n); if (result > 0) { return result; } advance(); } } return 0; }
/** * Closes the current reader and opens the next one, if any. */ private void advance() throws IOException { close(); if (it.hasNext()) { current = it.next().openStream(); } }
@Override public Reader getInput() throws IOException { return new MultiReader(suppliers.iterator()); } };
@Override public long skip(long n) throws IOException { Preconditions.checkArgument(n >= 0, "n is negative"); if (n > 0) { while (current != null) { long result = current.skip(n); if (result > 0) { return result; } advance(); } } return 0; }
/** * Closes the current reader and opens the next one, if any. */ private void advance() throws IOException { close(); if (it.hasNext()) { current = it.next().getInput(); } }