Class TextFileReader

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class TextFileReader
    extends Object
    implements Closeable
    Provides a simple tool to read text files with multiple fields on each row, such as csv-files.
    • Constructor Detail

      • TextFileReader

        public TextFileReader​(InputStream is)
        Creates a new TextFileReader with the default encoding and field separator.
        Parameters:
        is - the input stream to read.
      • TextFileReader

        public TextFileReader​(InputStream is,
                              Charset cs)
        Creates a new TextFileReader with the default field separator.
        Parameters:
        is - the input stream to read.
        cs - the charset to use
      • TextFileReader

        public TextFileReader​(InputStream is,
                              Charset cs,
                              String regex,
                              int limit)
        Parameters:
        is - the input stream
        cs - the encoding
        regex - field delimiter expression
        limit - the maximum number of times the regex is matched