class documentation

class InMemoryBlobSource(BaseBlobSource):

Constructor: InMemoryBlobSource(s, encoding)

View In Hierarchy

A BaseBlobSource implementation for in-memory blobs.

Method __init__ The default constructor.
Method get_blob Return a blob.
Method get_size Get the size of a blob from this factory.
Instance Variable s internal bytestring
def __init__(self, s, encoding=None):

The default constructor.

Parameters
s:bytes or strthe internal blob data.
encoding:str or Noneif s is a unicode string, encode it with this encoding. Defaults to constants.ENCODING.
def get_blob(self):

Return a blob.

Returns
BaseBloba fresh instance of a subclass of BaseBlob
def get_size(self):

Get the size of a blob from this factory.

The default implementation instantiates a new blob using BaseBlobSource.get_blob and calls BaseBlob.get_size. Subclasses may overwrite this method for a more efficient implementation.

Please See BaseBlob.get_size for details.

Returns
intthe size of a blob in byzes
s: bytes =

internal bytestring