MCPcopy
hub / github.com/bugsink/bugsink / read

Method read

bugsink/streams.py:245–255  ·  view source on GitHub ↗
(self, size=None)

Source from the content-addressed store, hash-verified

243 self.reason = str(max_length)
244
245 def read(self, size=None):
246 if size is None:
247 return self.read(self.max_length - self.bytes_read + 1) # +1 to trigger the max length check
248
249 result = self.stream.read(size)
250 self.bytes_read += len(result)
251
252 if self.bytes_read > self.max_length:
253 raise MaxLengthExceeded("Max length (%s) exceeded" % self.reason)
254
255 return result
256
257 def __getattr__(self, attr):
258 return getattr(self.stream, attr)

Callers 15

test_max_data_readerMethod · 0.95
zlib_generatorFunction · 0.45
brotli_generatorFunction · 0.45
compress_with_zlibFunction · 0.45
copy_stream_limitedFunction · 0.45
mainFunction · 0.45
br_bombMethod · 0.45

Calls 1

MaxLengthExceededClass · 0.85