MCPcopy Create free account
hub / github.com/apache/qpid-proton / encode

Method encode

python/proton/_data.py:803–818  ·  view source on GitHub ↗

Returns a binary representation of the data encoded in AMQP format. :return: The encoded data :raise: :exc:`DataException` if there is a Proton error.

(self)

Source from the content-addressed store, hash-verified

801 return pn_data_encoded_size(self._data)
802
803 def encode(self) -> bytes:
804 """
805 Returns a binary representation of the data encoded in AMQP format.
806
807 :return: The encoded data
808 :raise: :exc:`DataException` if there is a Proton error.
809 """
810 size = 1024
811 while True:
812 cd, enc = pn_data_encode(self._data, size)
813 if cd == PN_OVERFLOW:
814 size *= 2
815 elif cd >= 0:
816 return enc
817 else:
818 self._check(cd)
819
820 def decode(self, encoded: bytes) -> int:
821 """

Callers 15

string2utf8Function · 0.45
py2bytesFunction · 0.45
string2bytesFunction · 0.45
_testMethod · 0.45
testRoundTripMethod · 0.45
testBufferMethod · 0.45
testMemoryViewMethod · 0.45
testPropertiesMethod · 0.45
testBinaryPropertyKeyMethod · 0.45

Calls 2

_checkMethod · 0.95
pn_data_encodeFunction · 0.90

Tested by 1