Class CsvUtil
java.lang.Object
org.bgerp.plugin.inventory.sync1c.service.CsvUtil
Minimal RFC4180 CSV reader/writer for the sync1c File protocol — no CSV library is otherwise
used in this project, so a dedicated dependency isn't warranted for two simple flat formats.
Reads/writes UTF-8, and prepends a BOM on write so Excel opens Cyrillic text correctly.
-
Method Summary
Modifier and TypeMethodDescriptionparse(InputStream in) Parses a CSV stream into rows of raw string cells (no header interpretation here — callers that expect a header row should treat the first returned row specially).static voidwrite(OutputStream out, List<String[]> rows) Writes rows as CSV, quoting fields that contain a comma/quote/newline.
-
Method Details
-
parse
Parses a CSV stream into rows of raw string cells (no header interpretation here — callers that expect a header row should treat the first returned row specially). Handles quoted fields, embedded commas/newlines, and doubled-quote escaping. Strips a leading UTF-8 BOM if present.- Throws:
IOException
-
write
Writes rows as CSV, quoting fields that contain a comma/quote/newline. Prepends a UTF-8 BOM.- Throws:
IOException
-