Package org.faceless.pdf2
Interface Cache
-
- All Known Implementing Classes:
DiskCache
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 thePDFImage.close()
,PDFCanvas.flush()
,PDFPage.flush()
andPDFSound.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.
- Since:
- 2.2.2
- See Also:
PDF.setCache(org.faceless.pdf2.Cache)
,PDFPage.flush()
,PDFCanvas.flush()
,PDFImage.close()
,PDFSound.close()
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Cache.Entry
Represents a single entry in the Cache.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Cache.Entry
newEntry(int bytes)
Return a new Cache.Entry.
-
-
-
Method Detail
-
newEntry
Cache.Entry newEntry(int bytes)
Return a new Cache.Entry.- Parameters:
bytes
- the expected size of the buffer in byte
-
-