Class SqlDumpSpreadSheetReader.ChunkReader

    • Field Detail

      • m_ChunkSize

        protected int m_ChunkSize
        the chunk size.
      • m_UseBackslashes

        protected boolean m_UseBackslashes
        whether to backslashes are used for escaping single quotes.
      • m_HeaderCells

        protected List<String> m_HeaderCells
        the header cells to use.
    • Constructor Detail

      • ChunkReader

        public ChunkReader​(SqlDumpSpreadSheetReader owner)
        Initializes the low-level reader.
        Parameters:
        owner - the owning reader
    • Method Detail

      • unquote

        protected String unquote​(String s)
        Unquotes the given string.
        Parameters:
        s - the string to unquote, if necessary
        Returns:
        the processed string
      • removeTrailingCR

        protected void removeTrailingCR​(StringBuilder current)
        Removes a trailing CR.
        Parameters:
        current - the current buffer
      • readCells

        protected List<String> readCells​(Reader reader)
                                  throws IOException
        Reads a row and breaks it up into cells.
        Parameters:
        reader - the reader to read from
        Returns:
        the cells, null if nothing could be read (EOF)
        Throws:
        IOException - if reading fails, e.g., due to IO error
      • next

        public SpreadSheet next()
        Reads the next chunk.
        Returns:
        the next chunk
      • hasNext

        public boolean hasNext()
        Returns whether there is more data to be read.
        Returns:
        true if more data available
      • read

        public SpreadSheet read​(Reader r,
                                int chunkSize)
        Reads the spreadsheet content from the specified reader.
        Parameters:
        r - the reader to read from
        chunkSize - the number of rows to read at a time
        Returns:
        the spreadsheet or null in case of an error