Class IntelligentFileReader

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

    public class IntelligentFileReader
    extends java.io.Reader
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String encoding  
      private java.io.FileReader fr  
      private java.io.InputStream is  
      private static java.util.logging.Logger logger  
      private java.io.LineNumberReader lr  
      • Fields inherited from class java.io.Reader

        lock
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      int getLineNumber()  
      static java.lang.String load​(java.io.File filename)  
      static java.lang.String load​(java.io.InputStream stream)  
      static java.lang.String load​(java.io.Reader reader)  
      static java.lang.String load​(java.lang.String filename)  
      static java.lang.String load​(java.net.URL url)  
      int read​(char[] cbuf, int off, int len)  
      static byte[] readBytes​(java.io.File file)  
      static byte[] readBytes​(java.io.File file, int length)  
      java.lang.String readLine()  
      • Methods inherited from class java.io.Reader

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

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

      • logger

        private static final java.util.logging.Logger logger
      • fr

        private java.io.FileReader fr
      • is

        private java.io.InputStream is
      • lr

        private java.io.LineNumberReader lr
      • encoding

        private java.lang.String encoding
    • Constructor Detail

      • IntelligentFileReader

        public IntelligentFileReader​(java.lang.String file)
      • IntelligentFileReader

        public IntelligentFileReader​(java.io.InputStream inputStream)
      • IntelligentFileReader

        public IntelligentFileReader​(java.io.Reader reader)
      • IntelligentFileReader

        public IntelligentFileReader​(java.io.File file)
      • IntelligentFileReader

        public IntelligentFileReader​(java.io.File file,
                                     java.lang.String encoding)
      • IntelligentFileReader

        public IntelligentFileReader​(java.net.URLConnection connection)
                              throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • readLine

        public java.lang.String readLine()
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in class java.io.Reader
      • getLineNumber

        public int getLineNumber()
      • 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
      • load

        public static java.lang.String load​(java.lang.String filename)
      • load

        public static java.lang.String load​(java.io.File filename)
      • load

        public static java.lang.String load​(java.io.InputStream stream)
      • load

        public static java.lang.String load​(java.io.Reader reader)
      • readBytes

        public static byte[] readBytes​(java.io.File file)
      • readBytes

        public static byte[] readBytes​(java.io.File file,
                                       int length)
      • load

        public static java.lang.String load​(java.net.URL url)
                                     throws java.io.IOException
        Throws:
        java.io.IOException