class documentation

class FileBlob(BaseBlob):

Constructor: FileBlob(path)

View In Hierarchy

A BaseBlob used by FileBlobSource for file blobs.

Method __init__ The default constructor.
Method close Called when this blob is no longer needed.
Method get_size Return the size of this blob.
Method read Read up to n bytes from the blob.
Instance Variable _f file-like object handling the data
Instance Variable _path path to file
Instance Variable _size size of the file/blob
def __init__(self, path):

The default constructor.

Parameters
path:strpath to file
def close(self):

Called when this blob is no longer needed.

Use this method to clean up any associated resources.

def get_size(self):

Return the size of this blob.

This value should never be lower than the actual size.

Returns
intthe size of this blob in bytes
def read(self, n):

Read up to n bytes from the blob.

The "n" parameter indicates the max amount of bytes that should be returned. It is meant as a mere suggestion and can safely be ignored.

This function should return an empty bytestring if all data has been read.

Returns
bytesa chunk of data read from the blob
_f: file-like =

file-like object handling the data

_path: str =

path to file

_size: int =

size of the file/blob