
Reading and Writing Excel in Java With Apache POI Safely
Read and write Excel in Java with Apache POI: cell types, DataFormatter, formulas, streaming with SXSSF and event readers, and zip safety limits.
Tag
9 posts

Read and write Excel in Java with Apache POI: cell types, DataFormatter, formulas, streaming with SXSSF and event readers, and zip safety limits.

Read JSON in Java with Jackson 2.20: records, JsonNode trees, unknown fields, duplicate keys, the nesting and number limits, and the date trap on writing.

Measured heap needs for 36.6 MB of XML in Java: DOM fails at 256 MB, StAX with JAXB per record runs in 16 MB, and the memory is flat whatever the file size.

Map XML to Java classes with Jakarta XML Binding, read attributes, lists and optional elements, and see a bad boolean and a bad number accepted silently.

The three Java XML APIs on one 36.6 MB file: DOM ran out of memory at a 256 MB heap and took 1.03 s with 1 GB, while SAX and StAX ran in 32 MB in about 0.3 s.

Read CSV in Java with OpenCSV and Commons CSV: a backslash escape that breaks paths, ints that turn blanks into 0, and a writer that quotes everything.

Ten languages read the same awkward CSV files: speed on 2,000,000 rows, BOM, bad quotes, ragged rows, leading zeros and defaults that bite, plus a test list.

One XML file and one task in eight languages, with each output, the defaults that change your data, and how each treats absent, empty and bad values.

Parser settings that stop XXE in Java and Python, tested on one file: which Java features block it, what each error says, and the lxml options.