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

Method getbuffer

python/pyfory/_fory.py:68–76  ·  view source on GitHub ↗

Return serialized data as memoryview for zero-copy access. Returns: memoryview: A memoryview of the serialized data. For objects with contiguous memory (bytes, bytearray, numpy arrays), this is zero-copy. For non-contiguous data, a copy m

(self)

Source from the content-addressed store, hash-verified

66
67 @abstractmethod
68 def getbuffer(self) -> memoryview:
69 """
70 Return serialized data as memoryview for zero-copy access.
71
72 Returns:
73 memoryview: A memoryview of the serialized data. For objects with
74 contiguous memory (bytes, bytearray, numpy arrays), this is zero-copy.
75 For non-contiguous data, a copy may be created to ensure contiguity.
76 """
77
78 def raw(self):
79 return memoryview(self.getbuffer())

Calls

no outgoing calls