net.dontdrinkandroot.cache.impl.disk.indexed

## Class ByteArrayIndexedDiskCache

- java.lang.Object
- - net.dontdrinkandroot.cache.impl.AbstractCache<K,V>
  - - net.dontdrinkandroot.cache.impl.AbstractMapBackedCache<K,V,M>
    - - net.dontdrinkandroot.cache.impl.AbstractMapBackedCustomTtlCache<K,V,BlockMetaData>
      - - net.dontdrinkandroot.cache.impl.disk.indexed.AbstractIndexedDiskCache<Serializable,byte[]>
        - - net.dontdrinkandroot.cache.impl.disk.indexed.ByteArrayIndexedDiskCache

All Implemented Interfaces:
  Cache<Serializable,byte[]>, CustomTtlCache<Serializable,byte[]>

    public class ByteArrayIndexedDiskCache
    extends AbstractIndexedDiskCache<Serializable,byte[]>

Author:
  Philip W. Sorst <philip@sorst.net>

### Field Summary

### Fields inherited from class net.dontdrinkandroot.cache.impl.disk.indexed.AbstractIndexedDiskCache

`dataFile, indexFile, lockFile`

### Fields inherited from interface net.dontdrinkandroot.cache.Cache

`UNLIMITED_IDLE_TIME`

### Constructor Summary

Constructors
Constructor and Description
`ByteArrayIndexedDiskCache(String name, long defaultTimeToLive, ExpungeStrategy expungeStrategy, File baseDir)`
`ByteArrayIndexedDiskCache(String name, long defaultTimeToLive, long defaultMaxIdleTime, ExpungeStrategy expungeStrategy, File baseDir)`

### Method Summary

Methods
`boolean` `assertAllocatedConsistency()`
`byte[]` `dataFromBytes(byte[] data)`
`byte[]` `dataToBytes(byte[] data)`
`int` `getDataFileNumAllocatedBlocks()`
`int` `getMetaFileNumAllocatedBlocks()`

### Methods inherited from class net.dontdrinkandroot.cache.impl.disk.indexed.AbstractIndexedDiskCache

`buildIndex, close, doDelete, doGet, doPut`

### Methods inherited from class net.dontdrinkandroot.cache.impl.AbstractMapBackedCustomTtlCache

`doPut, put, put`

### Methods inherited from class net.dontdrinkandroot.cache.impl.AbstractMapBackedCache

`cleanUp, delete, delete, expunge, get, getEntriesMetaData, getEntriesMetaDataMap, getExpungeStrategy, getMetaData, getStatistics, put, setEntriesMetaDataMap, setExpungeStrategy`

### Methods inherited from class net.dontdrinkandroot.cache.impl.AbstractCache

`getCleanUpLogger, getDefaultMaxIdleTime, getDefaultTtl, getLogger, getName, setDefaultMaxIdleTime, setDefaultTtl`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface net.dontdrinkandroot.cache.Cache

`cleanUp, delete, get, getDefaultMaxIdleTime, getDefaultTtl, getMetaData, getName, getStatistics, put`

### Constructor Detail

#### ByteArrayIndexedDiskCache

    public ByteArrayIndexedDiskCache(String name,
                             long defaultTimeToLive,
                             ExpungeStrategy expungeStrategy,
                             File baseDir)
                              throws IOException

Throws:
  `IOException`

#### ByteArrayIndexedDiskCache

    public ByteArrayIndexedDiskCache(String name,
                             long defaultTimeToLive,
                             long defaultMaxIdleTime,
                             ExpungeStrategy expungeStrategy,
                             File baseDir)
                              throws IOException

Throws:
  `IOException`

### Method Detail

#### dataToBytes

    public byte[] dataToBytes(byte[] data)
                       throws CacheException

Specified by:
  `dataToBytes` in class `AbstractIndexedDiskCache<Serializable,byte[]>`
Throws:
  `CacheException`

#### dataFromBytes

    public byte[] dataFromBytes(byte[] data)
                         throws CacheException

Specified by:
  `dataFromBytes` in class `AbstractIndexedDiskCache<Serializable,byte[]>`
Throws:
  `CacheException`

#### getMetaFileNumAllocatedBlocks

    public int getMetaFileNumAllocatedBlocks()

#### getDataFileNumAllocatedBlocks

    public int getDataFileNumAllocatedBlocks()

#### assertAllocatedConsistency

    public boolean assertAllocatedConsistency()