Lines Matching defs:read
1 """Functions that read and write gzipped files.
30 an existing file object to read from or write to.
59 elif hasattr(filename, "read") or hasattr(filename, "write"):
76 """Minimal read-only file object that prepends a string to the contents
86 def read(self, size):
88 return self.file.read(size)
90 read = self._read
92 return self._buffer[read:self._read]
94 read = self._read
96 return self._buffer[read:] + \
97 self.file.read(size-self._length+read)
102 else: # Assume data was read since the last prepend() call
153 'xb' depending on whether the file will be read or written. The default
225 """Last modification time read from stream, or None"""
276 raise OSError(errno.EBADF, "write() on read-only GzipFile object")
296 def read(self, size=-1):
300 raise OSError(errno.EBADF, "read() on write-only GzipFile object")
301 return self._buffer.read(size)
408 data = fp.read(n)
410 b = fp.read(n - len(data))
423 magic = fp.read(2)
441 s = fp.read(1)
447 s = fp.read(1)
474 def read(self, size=-1):
487 # so finish up this member, and read a new gzip header.
488 # Check the CRC and file size, and set the flag so we read
505 buf = self._fp.read(io.DEFAULT_BUFFER_SIZE)
511 # Prepend the already read bytes to the fileobj so they can
530 # We've read to the end of the file
546 c = self._fp.read(1)
658 chunk = f.read(io.DEFAULT_BUFFER_SIZE)