Skip to content

Commit 497d3cb

Browse files
committed
Add documentation about parsing CSV content into memory
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1522861 13f79535-47bb-0310-9956-ffa450edef68
1 parent 8a5f777 commit 497d3cb

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

src/main/java/org/apache/commons/csv/CSVParser.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,28 @@
9292
*
9393
* <h4>Parsing completely into memory</h4>
9494
* <p>
95-
* You may also get a List of records:
95+
* If parsing record wise is not desired, the contents of the input can be read completely into memory.
9696
* </p>
9797
*
9898
* <pre>
9999
* Reader in = new StringReader(&quot;a;b\nc;d&quot;);
100100
* CSVParser parser = new CSVParser(in, CSVFormat.EXCEL);
101101
* List&lt;CSVRecord&gt; list = parser.getRecords();
102102
* </pre>
103+
*
104+
* <p>
105+
* There are two constraints that have to be kept in mind:
106+
* </p>
107+
*
108+
* <p>
109+
* <ol>
110+
* <li>Parsing into memory starts at the current position of the parser. If you have already parsed records from
111+
* the input, those records will not end up in the in memory representation of your CSV data.</li>
112+
* <li>Parsing into memory may consume a lot of system resources depending on the input. For example if you're
113+
* parsing a 150MB file of CSV data the contents will be read completely into memory.</li>
114+
* </ol>
115+
* </p>
116+
*
103117
* <p>
104118
* Internal parser state is completely covered by the format and the reader-state.
105119
* </p>

0 commit comments

Comments
 (0)