This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
We are trying to parse data received in vCard2.1 format and populate several value objects which are later written to relational database. The vCard data is received as a single long string and to fetch values of different fields we are performing a String#split() operation.
It is observed that lot of GC cycles happen during this time and we were wondering if instead of split(), we could use something else. Like Java's Scanner API.
1. Will replacing split() calls with Scanner APIs reduce the number of objects created on heap?
2. Can regex be an option worth considering here?