MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / read

Method read

tools/python-3.11.9-amd64/Lib/wave.py:164–185  ·  view source on GitHub ↗

Read at most size bytes from the chunk. If size is omitted or negative, read until the end of the chunk.

(self, size=-1)

Source from the content-addressed store, hash-verified

162 return self.size_read
163
164 def read(self, size=-1):
165 """Read at most size bytes from the chunk.
166 If size is omitted or negative, read until the end
167 of the chunk.
168 """
169
170 if self.closed:
171 raise ValueError("I/O operation on closed file")
172 if self.size_read >= self.chunksize:
173 return b''
174 if size < 0:
175 size = self.chunksize - self.size_read
176 if size > self.chunksize - self.size_read:
177 size = self.chunksize - self.size_read
178 data = self.file.read(size)
179 self.size_read = self.size_read + len(data)
180 if self.size_read == self.chunksize and \
181 self.align and \
182 (self.chunksize & 1):
183 dummy = self.file.read(1)
184 self.size_read = self.size_read + len(dummy)
185 return data
186
187 def skip(self):
188 """Skip the rest of the chunk.

Callers 5

skipMethod · 0.95
__init__Method · 0.45
initfpMethod · 0.45
readframesMethod · 0.45
_read_fmt_chunkMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected