class documentation
class BaseBlob(object):
Known subclasses: pyzim.blob.EmptyBlob, pyzim.blob.EntryBlob, pyzim.blob.FileBlob, pyzim.blob.InMemoryBlob
Base class for blobs
A Blob provides binary content to be written to a ZIM file.
In a simplified manner, a BaseBlob behaves similiar to a file-like object.
| Method | close |
Called when this blob is no longer needed. |
| Method | get |
Return the size of this blob. |
| Method | read |
Read up to n bytes from the blob. |
overridden in
pyzim.blob.EmptyBlob, pyzim.blob.EntryBlob, pyzim.blob.FileBlob, pyzim.blob.InMemoryBlobCalled when this blob is no longer needed.
Use this method to clean up any associated resources.
overridden in
pyzim.blob.EmptyBlob, pyzim.blob.EntryBlob, pyzim.blob.FileBlob, pyzim.blob.InMemoryBlobReturn the size of this blob.
This value should never be lower than the actual size.
| Returns | |
int | the size of this blob in bytes |
overridden in
pyzim.blob.EmptyBlob, pyzim.blob.EntryBlob, pyzim.blob.FileBlob, pyzim.blob.InMemoryBlobRead 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 | |
bytes | a chunk of data read from the blob |