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

Method read1

Lib/bz2.py:174–184  ·  view source on GitHub ↗

Read up to size uncompressed bytes, while trying to avoid making multiple reads from the underlying stream. Reads up to a buffer's worth of data if size is negative. Returns b'' if the file is at EOF.

(self, size=-1)

Source from the content-addressed store, hash-verified

172 return self._buffer.read(size)
173
174 def read1(self, size=-1):
175 """Read up to size uncompressed bytes, while trying to avoid
176 making multiple reads from the underlying stream. Reads up to a
177 buffer's worth of data if size is negative.
178
179 Returns b'' if the file is at EOF.
180 """
181 self._check_can_read()
182 if size < 0:
183 size = io.DEFAULT_BUFFER_SIZE
184 return self._buffer.read1(size)
185
186 def readinto(self, b):
187 """Read bytes into b.

Callers

nothing calls this directly

Calls 1

_check_can_readMethod · 0.80

Tested by

no test coverage detected