MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / read

Method read

opcua/common/utils.py:60–72  ·  view source on GitHub ↗

read and pop number of bytes for buffer

(self, size)

Source from the content-addressed store, hash-verified

58 return self._size
59
60 def read(self, size):
61 """
62 read and pop number of bytes for buffer
63 """
64 if size > self._size:
65 raise NotEnoughData("Not enough data left in buffer, request for {0}, we have {1}".format(size, self))
66 # self.logger.debug("Request for %s bytes, from %s", size, self)
67 self._size -= size
68 pos = self._cur_pos
69 self._cur_pos += size
70 data = self._data[pos:self._cur_pos]
71 # self.logger.debug("Returning: %s ", data)
72 return data
73
74 def copy(self, size=-1):
75 """

Callers 15

from_header_and_bodyMethod · 0.95
bump_versionFunction · 0.45
load_certificateFunction · 0.45
load_private_keyFunction · 0.45
unpackMethod · 0.45
unpackMethod · 0.45
unpackMethod · 0.45
unpack_arrayMethod · 0.45
nodeid_from_binaryFunction · 0.45
variant_from_binaryFunction · 0.45

Calls 1

NotEnoughDataClass · 0.85

Tested by

no test coverage detected