Class CsvBufferedReader

java.lang.Object
java.io.Reader
java.io.BufferedReader
overit.geocall.util.CsvBufferedReader
All Implemented Interfaces:
Closeable, AutoCloseable, Readable

public class CsvBufferedReader extends BufferedReader
Reads text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines for CVS.
  • Field Details

    • EMPTYLINE_STOP

      public static final int EMPTYLINE_STOP
      See Also:
    • EMPTYLINE_SKIP

      public static final int EMPTYLINE_SKIP
      See Also:
    • EMPTYLINE_RETURN

      public static final int EMPTYLINE_RETURN
      See Also:
    • _sep

      protected char _sep
    • _quote

      protected char _quote
    • _quotesep

      protected String _quotesep
    • _emptyLineManagement

      protected int _emptyLineManagement
  • Constructor Details

    • CsvBufferedReader

      public CsvBufferedReader(Reader in)
      Creates a buffering character-input stream that uses a default-sized input buffer.
      Parameters:
      in - A Reader
    • CsvBufferedReader

      public CsvBufferedReader(Reader in, int sz)
      Creates a buffering character-input stream that uses an input buffer of the specified size.
      Parameters:
      in - A Reader
      sz - Input-buffer size
  • Method Details

    • setEmptyLineManagement

      public void setEmptyLineManagement(int mode)
      Sets the empty line management. Possible values are: 0: EMPTYLINE_STOP (default one) 1: EMPTYLINE_SKIP 2: EMPTYLINE_RETURN
      Parameters:
      mode - The mode selected
    • setSeparator

      public void setSeparator(char c)
      Sets the separator
      Parameters:
      c - The separator
    • setQuote

      public void setQuote(char c)
      Sets the quote
      Parameters:
      c - The quote
    • countQuote

      protected int countQuote(String s)
    • readCsvLine

      public ArrayList<String> readCsvLine() throws IOException
      Read the CSV line
      Returns:
      An ArrayList of string with the CSV
      Throws:
      IOException - if an I/O error occurs