Lines Matching refs:raw
61 encoding used is platform dependent. (For reading and writing raw
189 raw = FileIO(file,
196 if buffering == 1 or buffering < 0 and raw.isatty():
202 bs = os.fstat(raw.fileno()).st_blksize
212 return raw
215 buffer = BufferedRandom(raw, buffering)
217 buffer = BufferedWriter(raw, buffering)
219 buffer = BufferedReader(raw, buffering)
529 """Base class for raw binary I/O."""
601 BlockingIOError if the underlying raw stream is in non-blocking
602 mode and not ready; unlike their raw counterparts, they will never
615 If the argument is positive, and the underlying raw stream is
616 not 'interactive', multiple raw reads may be issued to satisfy
618 interactive raw streams (XXX and for pipes?), at most one raw
624 Raises BlockingIOError if the underlying raw stream has no
636 Like read(), this may issue multiple reads to the underlying raw
641 Raises BlockingIOError if the underlying raw stream has no
663 underlying raw stream cannot accept more data at the moment.
669 Separate the underlying raw stream from the buffer and return it.
671 After the raw stream has been detached, the buffer is in an unusable
681 """A mixin implementation of BufferedIOBase with an underlying raw stream.
683 This passes most requests on to the underlying raw stream. It
688 def __init__(self, raw):
689 self._raw = raw
694 new_position = self.raw.seek(pos, whence)
700 pos = self.raw.tell()
715 return self.raw.truncate(pos)
722 self.raw.flush()
725 if self.raw is not None and not self.closed:
730 self.raw.close()
733 if self.raw is None:
734 raise ValueError("raw stream already detached")
736 raw = self._raw
738 return raw
743 return self.raw.seekable()
746 return self.raw.readable()
749 return self.raw.writable()
752 def raw(self):
757 return self.raw.closed
761 return self.raw.name
765 return self.raw.mode
779 return self.raw.fileno()
782 return self.raw.isatty()
905 """BufferedReader(raw[, buffer_size])
909 The constructor creates a BufferedReader for the given readable raw
914 def __init__(self, raw, buffer_size=DEFAULT_BUFFER_SIZE):
915 """Create a new buffered reader using the given readable raw IO object.
917 if not raw.readable():
918 raise IOError('"raw" argument must be readable.')
920 _BufferedIOMixin.__init__(self, raw)
934 Returns exactly n bytes of data unless the underlying raw IO
958 chunk = self.raw.read()
982 chunk = self.raw.read(wanted)
1004 do at most one raw read to satisfy it. We never return more
1017 current = self.raw.read(to_read)
1031 # only return buffered bytes. Otherwise, we do one raw read.
1058 The constructor creates a BufferedWriter for the given writeable raw
1065 def __init__(self, raw,
1067 if not raw.writable():
1068 raise IOError('"raw" argument must be writable.')
1070 _BufferedIOMixin.__init__(self, raw)
1112 pos = self.raw.tell()
1113 return self.raw.truncate(pos)
1124 n = self.raw.write(self._write_buf)
1126 raise RuntimeError("self.raw should implement RawIOBase: it "
1228 raw, given in the first argument. If the buffer_size is omitted it
1234 def __init__(self, raw,
1236 raw._checkSeekable()
1237 BufferedReader.__init__(self, raw, buffer_size)
1238 BufferedWriter.__init__(self, raw, buffer_size, max_buffer_size)
1247 self.raw.seek(self._read_pos - len(self._read_buf), 1)
1248 # First do the raw seek, then empty the read buffer, so that
1249 # if the raw seek fails, we don't lose buffered data forever.
1250 pos = self.raw.seek(pos, whence)
1291 self.raw.seek(self._read_pos - len(self._read_buf), 1)