MCPcopy Create free account
hub / github.com/rthalley/dnspython / get_bytes

Method get_bytes

dns/wire.py:32–39  ·  view source on GitHub ↗
(self, size: int)

Source from the content-addressed store, hash-verified

30 return self.end - self.current
31
32 def get_bytes(self, size: int) -> bytes:
33 assert size >= 0
34 if size > self.remaining():
35 raise dns.exception.FormError
36 output = self.wire[self.current : self.current + size]
37 self.current += size
38 self.furthest = max(self.furthest, self.current)
39 return output
40
41 def get_counted_bytes(self, length_size: int = 1) -> bytes:
42 length = int.from_bytes(self.get_bytes(length_size), "big")

Callers 15

get_counted_bytesMethod · 0.95
get_remainingMethod · 0.95
get_uint8Method · 0.95
get_uint16Method · 0.95
get_uint32Method · 0.95
get_uint48Method · 0.95
get_structMethod · 0.95
from_wire_parserFunction · 0.80
from_wire_parserMethod · 0.80
from_wire_parserMethod · 0.80
from_wire_parserMethod · 0.80
from_wire_parserMethod · 0.80

Calls 1

remainingMethod · 0.95

Tested by

no test coverage detected