io.BytesIO.read1()

read1() In BytesIO, this is the same as read().

io.BytesIO.getvalue()

getvalue() Return bytes containing the entire contents of the buffer.

io.BytesIO.getbuffer()

getbuffer() Return a readable and writable view over the contents of the buffer without copying them. Also, mutating the view will transparently update the contents of the buffer: >>> b = io.BytesIO(b"abcdef") >>> view = b.getbuffer() >>> view[2:4] = b"56" >>> b.getvalue() b'ab56ef' Note As long as the view exists, the BytesIO object cannot be resized or closed. New in version 3.2.

io.BytesIO

class io.BytesIO([initial_bytes]) A stream implementation using an in-memory bytes buffer. It inherits BufferedIOBase. The buffer is discarded when the close() method is called. The optional argument initial_bytes is a bytes-like object that contains initial data. BytesIO provides or overrides these methods in addition to those from BufferedIOBase and IOBase: getbuffer() Return a readable and writable view over the contents of the buffer without copying them. Also, mutating the view will

io.BufferedWriter.write()

write(b) Write the bytes-like object, b, and return the number of bytes written. When in non-blocking mode, a BlockingIOError is raised if the buffer needs to be written out but the raw stream blocks.

io.BufferedWriter.flush()

flush() Force bytes held in the buffer into the raw stream. A BlockingIOError should be raised if the raw stream blocks.

io.BufferedWriter

class io.BufferedWriter(raw, buffer_size=DEFAULT_BUFFER_SIZE) A buffer providing higher-level access to a writeable, sequential RawIOBase object. It inherits BufferedIOBase. When writing to this object, data is normally placed into an internal buffer. The buffer will be written out to the underlying RawIOBase object under various conditions, including: when the buffer gets too small for all pending data; when flush() is called; when a seek() is requested (for BufferedRandom objects); when th

io.BufferedRWPair

class io.BufferedRWPair(reader, writer, buffer_size=DEFAULT_BUFFER_SIZE) A buffered I/O object combining two unidirectional RawIOBase objects – one readable, the other writeable – into a single bidirectional endpoint. It inherits BufferedIOBase. reader and writer are RawIOBase objects that are readable and writeable respectively. If the buffer_size is omitted it defaults to DEFAULT_BUFFER_SIZE. BufferedRWPair implements all of BufferedIOBase‘s methods except for detach(), which raises Unsupp

io.BufferedReader.read1()

read1(size) Read and return up to size bytes with only one call on the raw stream. If at least one byte is buffered, only buffered bytes are returned. Otherwise, one raw stream read call is made.

io.BufferedReader.read()

read([size]) Read and return size bytes, or if size is not given or negative, until EOF or if the read call would block in non-blocking mode.