public interface Cache
This interface represents a structure which can be used to store parts of a PDF to disk, a database or some other secondary storage, to reduce the amount of memory required to generate a PDF.
Generally speaking, an item is eligible for caching when the Cache.Entry.close()
method is called. This is called by the PDFImage.close()
, PDFCanvas.flush()
,
PDFPage.flush()
and PDFSound.close()
methods, and it is a good idea to
call these methods when you have created your image/canvas/page and won't be making
any further changes to it (hint - unless you're setting MetaData on a PDFImage, you
can close it immediately after it's created).
At that point, whether the item is swapped out is down the the implementation of the cache.
PDF.setCache(org.faceless.pdf2.Cache)
,
PDFPage.flush()
,
PDFCanvas.flush()
,
PDFImage.close()
,
PDFSound.close()
Modifier and Type | Interface and Description |
---|---|
static interface |
Cache.Entry
Represents a single entry in the Cache.
|
Modifier and Type | Method and Description |
---|---|
Cache.Entry |
newEntry(int bytes)
Return a new Cache.Entry.
|
Cache.Entry newEntry(int bytes)
bytes
- the expected size of the buffer in byteCopyright © 2001-2019 Big Faceless Organization