- class b2sdk.stream.wrapper.StreamWrapper(stream)
Wrapper for a file-like object.
stream – the stream to read from or write to
Return whether object supports random access.
If False, seek(), tell() and truncate() will raise OSError. This method may need to do a test seek().
- seek(pos, whence=0)
Seek to a given position in the stream.
Truncate file to size bytes.
File pointer is left unchanged. Size defaults to the current IO position as reported by tell(). Returns the new size.
Flush the stream.
Return whether object was opened for reading.
If False, read() will raise OSError.
Read data from the stream.
size (int) – number of bytes to read
data read from the stream
Return whether object was opened for writing.
If False, write() will raise OSError.
Write data to the stream.
data – a data to write to the stream