Lines Matching defs:raw
95 writing raw bytes use binary mode and leave encoding unspecified.) The
234 raw = FileIO(file,
241 result = raw
244 if buffering == 1 or buffering < 0 and raw.isatty():
250 bs = os.fstat(raw.fileno()).st_blksize
263 buffer = BufferedRandom(raw, buffering)
265 buffer = BufferedWriter(raw, buffering)
267 buffer = BufferedReader(raw, buffering)
625 """Base class for raw binary I/O."""
698 BlockingIOError if the underlying raw stream is in non-blocking
699 mode and not ready; unlike their raw counterparts, they will never
712 If the argument is positive, and the underlying raw stream is
713 not 'interactive', multiple raw reads may be issued to satisfy
715 interactive raw streams (XXX and for pipes?), at most one raw
721 Raises BlockingIOError if the underlying raw stream has no
735 Like read(), this may issue multiple reads to the underlying raw
740 Raises BlockingIOError if the underlying raw stream has no
751 Raises BlockingIOError if the underlying raw stream has no
779 underlying raw stream cannot accept more data at the moment.
785 Separate the underlying raw stream from the buffer and return it.
787 After the raw stream has been detached, the buffer is in an unusable
797 """A mixin implementation of BufferedIOBase with an underlying raw stream.
799 This passes most requests on to the underlying raw stream. It
804 def __init__(self, raw):
805 self._raw = raw
810 new_position = self.raw.seek(pos, whence)
816 pos = self.raw.tell()
834 return self.raw.truncate(pos)
841 self.raw.flush()
844 if self.raw is not None and not self.closed:
849 self.raw.close()
852 if self.raw is None:
853 raise ValueError("raw stream already detached")
855 raw = self._raw
857 return raw
862 return self.raw.seekable()
865 def raw(self):
870 return self.raw.closed
874 return self.raw.name
878 return self.raw.mode
896 return self.raw.fileno()
899 return self.raw.isatty()
1047 """BufferedReader(raw[, buffer_size])
1051 The constructor creates a BufferedReader for the given readable raw
1056 def __init__(self, raw, buffer_size=DEFAULT_BUFFER_SIZE):
1057 """Create a new buffered reader using the given readable raw IO object.
1059 if not raw.readable():
1060 raise OSError('"raw" argument must be readable.')
1062 _BufferedIOMixin.__init__(self, raw)
1070 return self.raw.readable()
1079 Returns exactly size bytes of data unless the underlying raw IO
1098 if hasattr(self.raw, 'readall'):
1099 chunk = self.raw.readall()
1108 chunk = self.raw.read()
1127 chunk = self.raw.read(wanted)
1145 do at most one raw read to satisfy it. We never return more
1156 current = self.raw.read(to_read)
1165 # only return buffered bytes. Otherwise, we do one raw read.
1209 n = self.raw.readinto(buf[written:])
1243 The constructor creates a BufferedWriter for the given writeable raw
1248 def __init__(self, raw, buffer_size=DEFAULT_BUFFER_SIZE):
1249 if not raw.writable():
1250 raise OSError('"raw" argument must be writable.')
1252 _BufferedIOMixin.__init__(self, raw)
1260 return self.raw.writable()
1294 pos = self.raw.tell()
1295 return self.raw.truncate(pos)
1306 n = self.raw.write(self._write_buf)
1308 raise RuntimeError("self.raw should implement RawIOBase: it "
1330 if self.raw is None or self.closed:
1341 self.raw.close()
1422 raw, given in the first argument. If the buffer_size is omitted it
1426 def __init__(self, raw, buffer_size=DEFAULT_BUFFER_SIZE):
1427 raw._checkSeekable()
1428 BufferedReader.__init__(self, raw, buffer_size)
1429 BufferedWriter.__init__(self, raw, buffer_size)
1438 self.raw.seek(self._read_pos - len(self._read_buf), 1)
1439 # First do the raw seek, then empty the read buffer, so that
1440 # if the raw seek fails, we don't lose buffered data forever.
1441 pos = self.raw.seek(pos, whence)
1486 self.raw.seek(self._read_pos - len(self._read_buf), 1)