Seemed to be causing issues in multi-JVM auto-tests. The added perf. benefit was
minor for Nippy's use case (~2-3%) - so this isn't an urgent change. Will
re-examine again later.
PROBLEM: :legacy-mode :auto/true thawing was resulting in JVM core
dumps when attempting to use Snappy to decompress encrypted data.
CAUSE: The org.iq80.snappy implementation seems to choke on the
random IV byte data being generated by the AES128 encrypter. This
may or may not be a bug (still awaiting feedback from lib's authors).
SOLUTION: We're only susceptible to this issue when trying to
decompress data that is: a) encrypted, b) being thawed in legacy mode.
In particular, we're _not_ susceptible to this issue when thawing
in non-legacy mode because in that case we have a header explicitly
warning us that the data is encrypted.
An obvious work-around, therefore, is just to disable decryption when
attempting to thaw legacy-mode data. In practice this isn't a problem
because older versions of Nippy didn't support encryption anyway.
This (native Java) implementation appears to be about as fast as
the old (JNI) implementation, but has better support across more platforms.
Going to evaluate stability on this branch for possible later merging into master.
Breaks only for users that were overriding `freeze-to-bytes` or `thaw-from-bytes` defaults to disable
compression.
Changed to map-based config to allow extra control (like :read-eval? as suggested by Luc Préfontaine).
This change will also allow further additions in future without the need to break the API again.
Luc Préfontaine kindly pointed out that `.writeUTF` and `.readUTF` have a maximum length of
64k. This commit switches to a custom integer-length prefix for strings and reader types to
boost their max length. Keywords are unchanged.
Old string and reader type IDs are now deprecated but will continue to be supported for
thawing.
`write-as-bytes!` was unnecessarily general. Renamed as type-hinted `write-biginteger!`.
Improves write performance of all types that relied on `write-as-bytes`: bigints, bigdecs,
rational.