code: public static Iterable<String> readLines(final File file,
        final Class<? extends InputStream> fileInputStreamWrapper) {
  
      return new Iterable<String>() {
        public Iterator<String> iterator() {
          return new Iterator<String>() {
  
            protected BufferedReader reader = this.getReader();
            protected String line = this.getLine();
  
            public boolean hasNext() {
              return this.line != null;
            }
  
            public String next() {
              String nextLine = this.line;
              if (nextLine == null) {
                throw new NoSuchElementException();
              }
              line = getLine();
              return nextLine;
            }
  
            protected String getLine() {
              try {
                String result = this.reader.readLine();
                if (result == null) {
                  this.reader.close();
                }
                return result;
              } catch (IOException e) {
                throw new RuntimeIOException(e);
              }
            }
  
            protected BufferedReader getReader() {
              try {
                InputStream stream = new FileInputStream(file);
                if (fileInputStreamWrapper != null) {
                  stream = fileInputStreamWrapper.getConstructor(
                      InputStream.class).newInstance(stream);
                }
                return new BufferedReader(new InputStreamReader(stream));
              } catch (Exception e) {
                throw new RuntimeIOException(e);
              }
            }
  
            public void remove() {
              throw new UnsupportedOperationException();
            }
          };
        }
      };
    }
docs: Returns an Iterable of the lines in the file, wrapping the generated
  FileInputStream with an instance of the supplied class. IO errors will
  throw an (unchecked) RuntimeIOException
  
  @param file
  The file whose lines are to be read.
  @param fileInputStreamWrapper
  The class to wrap the InputStream with, e.g. GZIPInputStream. Note
  that the class must have a constructor that accepts an
  InputStream.
  @return An Iterable containing the lines from the file.