MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / get_bytes

Method get_bytes

pager_lib/pymysql/protocol.py:101–110  ·  view source on GitHub ↗

Get 'length' bytes starting at 'position'. Position is start of payload (first four packet header bytes are not included) starting at index '0'. No error checking is done. If requesting outside end of buffer an empty string (or string shorter than 'length') may be

(self, position, length=1)

Source from the content-addressed store, hash-verified

99 self._position = position
100
101 def get_bytes(self, position, length=1):
102 """Get 'length' bytes starting at 'position'.
103
104 Position is start of payload (first four packet header bytes are not
105 included) starting at index '0'.
106
107 No error checking is done. If requesting outside end of buffer
108 an empty string (or string shorter than 'length') may be returned!
109 """
110 return self._data[position : (position + length)]
111
112 def read_uint8(self):
113 result = self._data[self._position]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected