MCPcopy Index your code
hub / github.com/python/cpython / _write_raw

Method _write_raw

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

Source from the content-addressed store, hash-verified

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

Callers 1

writeMethod · 0.80

Calls 2

writeMethod · 0.45
compressMethod · 0.45

Tested by

no test coverage detected