class documentation
class InMemoryBlobSource(BaseBlobSource):
Constructor: InMemoryBlobSource(s, encoding)
A BaseBlobSource implementation for in-memory blobs.
| Method | __init__ |
The default constructor. |
| Method | get |
Return a blob. |
| Method | get |
Get the size of a blob from this factory. |
| Instance Variable | s |
internal bytestring |
The default constructor.
| Parameters | |
s:bytes or str | the internal blob data. |
encoding:str or None | if s is a unicode string, encode it with this encoding. Defaults to constants.ENCODING. |
overrides
pyzim.blob.BaseBlobSource.get_sizeGet 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 | |
int | the size of a blob in byzes |