Class MultiReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Readable

    @GwtIncompatible
    class MultiReader
    extends java.io.Reader
    A Reader that concatenates multiple readers.
    Since:
    1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.Reader current  
      private java.util.Iterator<? extends CharSource> it  
      • Fields inherited from class java.io.Reader

        lock
    • Constructor Summary

      Constructors 
      Constructor Description
      MultiReader​(java.util.Iterator<? extends CharSource> readers)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void advance()
      Closes the current reader and opens the next one, if any.
      void close()  
      int read​(char[] cbuf, int off, int len)  
      boolean ready()  
      long skip​(long n)  
      • Methods inherited from class java.io.Reader

        mark, markSupported, nullReader, read, read, read, reset, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • it

        private final java.util.Iterator<? extends CharSource> it
      • current

        private java.io.Reader current
    • Constructor Detail

      • MultiReader

        MultiReader​(java.util.Iterator<? extends CharSource> readers)
             throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • advance

        private void advance()
                      throws java.io.IOException
        Closes the current reader and opens the next one, if any.
        Throws:
        java.io.IOException
      • read

        public int read​(char[] cbuf,
                        int off,
                        int len)
                 throws java.io.IOException
        Specified by:
        read in class java.io.Reader
        Throws:
        java.io.IOException
      • skip

        public long skip​(long n)
                  throws java.io.IOException
        Overrides:
        skip in class java.io.Reader
        Throws:
        java.io.IOException
      • ready

        public boolean ready()
                      throws java.io.IOException
        Overrides:
        ready in class java.io.Reader
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in class java.io.Reader
        Throws:
        java.io.IOException