Hello,

Is there a faster way to encode floating-point numbers in JsonGenerator? 
#writeNumber(double) falls back to Double.toString(), which is known to be 
not very efficient <https://stackoverflow.com/q/10553710/1278899>. In my 
particular case, I want to encode a j.u.Instant. Instant is, in principle, 
composed of epoch seconds (integral part) and nanos (fractional part). 
Hence, I can actually easily do #writeNumber("" + epochSeconds + '.' + 
epochSecondsNanos). Though, this has one caveat: String allocation. Given I 
have two long's denoting the integral and fractional parts of a 
floating-point number, is it possible to output this via JsonGenerator 
without extra allocation?

Best.

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jackson-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jackson-user/12fad6cb-0cbf-4817-9a32-fc9bf4272232%40googlegroups.com.

Reply via email to