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

Method write

python/pyfory/tests/test_buffer.py:72–78  ·  view source on GitHub ↗
(self, payload)

Source from the content-addressed store, hash-verified

70 self._data = bytearray()
71
72 def write(self, payload):
73 if not payload:
74 return 0
75 view = memoryview(payload).cast("B")
76 wrote = min(2, len(view))
77 self._data.extend(view[:wrote])
78 return wrote
79
80 def to_bytes(self):
81 return bytes(self._data)

Callers

nothing calls this directly

Calls 2

extendMethod · 0.80
castMethod · 0.45

Tested by

no test coverage detected