MCPcopy Index your code
hub / github.com/RustPython/RustPython / _write_raw

Method _write_raw

Lib/gzip.py:323–338  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

321 return self._buffer.write(data)
322
323 def _write_raw(self, data):
324 # Called by our self._buffer underlying WriteBufferStream.
325 if isinstance(data, (bytes, bytearray)):
326 length = len(data)
327 else:
328 # accept any data that supports the buffer protocol
329 data = memoryview(data)
330 length = data.nbytes
331
332 if length > 0:
333 self.fileobj.write(self.compress.compress(data))
334 self.size += length
335 self.crc = zlib.crc32(data, self.crc)
336 self.offset += length
337
338 return length
339
340 def _check_read(self, caller):
341 if self.mode != READ:

Callers 1

writeMethod · 0.80

Calls 4

isinstanceFunction · 0.85
lenFunction · 0.85
writeMethod · 0.45
compressMethod · 0.45

Tested by

no test coverage detected