MCPcopy Create free account
hub / github.com/PyMySQL/PyMySQL / get_bytes

Method get_bytes

pymysql/protocol.py:100–109  ·  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

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected