MCPcopy Create free account
hub / github.com/apache/fory / dump

Method dump

python/pyfory/_fory.py:765–780  ·  view source on GitHub ↗

Serialize an object directly to a writable stream. Notes: The stream must be a non-retaining sink: ``write(data)`` must synchronously consume ``data`` before returning. Fory may reuse or modify the underlying buffer after ``write`` returns, so re

(self, obj, stream)

Source from the content-addressed store, hash-verified

763 return self.deserialize(buffer, buffers, unsupported_objects)
764
765 def dump(self, obj, stream):
766 """
767 Serialize an object directly to a writable stream.
768
769 Notes:
770 The stream must be a non-retaining sink: ``write(data)`` must
771 synchronously consume ``data`` before returning. Fory may reuse or
772 modify the underlying buffer after ``write`` returns, so retaining
773 the passed object (or a view of it) is unsupported. If your sink
774 needs retention, copy bytes inside ``write``.
775 """
776 fory = self._get_fory()
777 try:
778 return fory.dump(obj, stream)
779 finally:
780 self._return_fory(fory)

Callers

nothing calls this directly

Calls 3

_get_foryMethod · 0.95
_return_foryMethod · 0.95
dumpMethod · 0.45

Tested by

no test coverage detected