b2sdk.stream.wrapper
StreamWrapper¶
-
class
b2sdk.stream.wrapper.
StreamWrapper
(stream)[source]¶ Bases:
io.IOBase
Wrapper for a file-like object.
-
seekable
()[source]¶ Return whether object supports random access.
If False, seek(), tell() and truncate() will raise OSError. This method may need to do a test seek().
-
truncate
(size=None)[source]¶ 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.
-
readable
()[source]¶ Return whether object was opened for reading.
If False, read() will raise OSError.
-
read
(size=None)[source]¶ Read data from the stream.
- Parameters
size (int) – number of bytes to read
- Returns
data read from the stream
-
-
class
b2sdk.stream.wrapper.
StreamWithLengthWrapper
(stream, length=None)[source]¶ Bases:
b2sdk.stream.wrapper.StreamWrapper
Wrapper for a file-like object that supports __len__ interface