Closed Outrovurt closed 2 years ago
Hi @Outrovurt,
The following example given for extending nippy for custom types only works if (:data x) is a string:
Correct
Q: If I want to serialize any other Clojure built-in here
Most built-in Clojure types should already have an appropriate implementation out-the-box. You can use nippy/freeze-to-out!
to do a type-appropriate freeze within a custom freezer.
In most cases if someone is writing a custom freezer, it's because they want to write directly against a DataOutput using its API.
Hope that helps!
Thanks a lot, that is exactly what I was looking for and it works perfectly! It also produces a reasonably smaller output than freeze-to-string
, so I'm very happy. :-)
The following example given for extending nippy for custom types only works if
(:data x)
is a string:Q: If I want to serialize any other Clojure built-in here, is the correct approach to use
freeze-to-string
? For example:I can't find anything obvious in the documentation as to how to pass non-string values to the
.writeUTF
method.