Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.faceless.pdf2
Class DiskCache

    java.lang.Object
      org.faceless.pdf2.DiskCache

All Implemented Interfaces:
  Cache

    public class DiskCache

extends Object
implements Cache

A general purpose `Cache` which optionally writes closed streams to files on disk. This class has been tested on UNIX and Windows under multi-threaded environments, and we see no reason why it shouldn't work under other platforms as well. Here's a simple example:

       Cache cache = new DiskCache(System.getProperty("java.io.tmpdir")+"/pdftemp.", 8192);
       PDF.setCache(cache);

Since:
  2.2.2
See Also:
  `PDF.setCache(org.faceless.pdf2.Cache)`

Nested Class Summary

Nested classes/interfaces inherited from interface org.faceless.pdf2.Cache
`Cache.Entry`

Constructor Summary
`DiskCache(String prefix, int threshold)` Create a new DiskCache

Method Summary
`Cache.Entry` | `newEntry(int size)` Return a new Cache.Entry.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DiskCache

    public DiskCache(String prefix,
                     int threshold)

  Create a new DiskCache

  Parameters:
    `prefix` - The prefix to begin the cached filenames with. For instance, if prefix was "/tmp/cache/mycache.", the cache files would be "/tmp/cache/mycache.0", "/tmp/cache/mycache.1" etc.
    `threshold` - the minimum number of bytes that are considered worth caching to disk, or 0 to prevent caching altogether

Method Detail

### newEntry

    public Cache.Entry newEntry(int size)

  Description copied from interface: `Cache`
  Return a new Cache.Entry.

  Specified by:
    `newEntry` in interface `Cache`
  Parameters:
    `size` - the expected size of the buffer in byte

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2012 Big Faceless Organization