generator.flush();
generator.close();
// jackson likely will add leading/trailing "" which are added down the pipeline so remove them
// however that's not mandatory in case the source is a number (instead of a string)
if ((lookForQuotes && !addQuotesIfNecessary) && ba.bytes()[ba.offset()] == '"') {
ba.size(Math.max(0, ba.length() - 2));
ba.offset(1);
}
}
}